target
stringlengths 20
113k
| src_fm
stringlengths 11
86.3k
| src_fm_fc
stringlengths 21
86.4k
| src_fm_fc_co
stringlengths 30
86.4k
| src_fm_fc_ms
stringlengths 42
86.8k
| src_fm_fc_ms_ff
stringlengths 43
86.8k
|
---|---|---|---|---|---|
@Test public void testFindLongestPrefixWithNonPrefix() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("An InterledgerAddressPrefix MUST not end with a period (.) character"); this.prefixMap = constructPopulatedPrefixMap(); prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.foo.")); }
|
@VisibleForTesting protected Optional<InterledgerAddressPrefix> findLongestPrefix( final InterledgerAddressPrefix destinationAddressPrefix ) { Objects.requireNonNull(destinationAddressPrefix, "destinationAddressPrefix must not be null!"); String destinationPrefixKey = toTrieKey(destinationAddressPrefix); final SortedMap<String, R> prefixSubMap = filterLongerPrefixes(destinationPrefixKey, prefixMap.prefixMap(destinationPrefixKey)); if (prefixSubMap.isEmpty() && destinationAddressPrefix.hasPrefix()) { return destinationAddressPrefix.getPrefix() .map(parentPrefix -> { final Optional<InterledgerAddressPrefix> longestMatch = this.findLongestPrefix(parentPrefix); if (longestMatch.isPresent()) { return longestMatch; } else { return this.findLongestPrefix(destinationAddressPrefix.getRootPrefix()); } }) .orElse(Optional.empty()); } else { return prefixSubMap.keySet().stream() .filter(val -> val.length() <= (destinationAddressPrefix.getValue().length() + 1)) .distinct() .map(prefix -> prefix.substring(0, prefix.length() - 1)) .map(InterledgerAddressPrefix::of) .collect(Collectors.reducing((a, b) -> { logger.error( "Routing table has more than one longest-match! This should never happen!" ); return null; }) ); } }
|
InterledgerAddressPrefixMap { @VisibleForTesting protected Optional<InterledgerAddressPrefix> findLongestPrefix( final InterledgerAddressPrefix destinationAddressPrefix ) { Objects.requireNonNull(destinationAddressPrefix, "destinationAddressPrefix must not be null!"); String destinationPrefixKey = toTrieKey(destinationAddressPrefix); final SortedMap<String, R> prefixSubMap = filterLongerPrefixes(destinationPrefixKey, prefixMap.prefixMap(destinationPrefixKey)); if (prefixSubMap.isEmpty() && destinationAddressPrefix.hasPrefix()) { return destinationAddressPrefix.getPrefix() .map(parentPrefix -> { final Optional<InterledgerAddressPrefix> longestMatch = this.findLongestPrefix(parentPrefix); if (longestMatch.isPresent()) { return longestMatch; } else { return this.findLongestPrefix(destinationAddressPrefix.getRootPrefix()); } }) .orElse(Optional.empty()); } else { return prefixSubMap.keySet().stream() .filter(val -> val.length() <= (destinationAddressPrefix.getValue().length() + 1)) .distinct() .map(prefix -> prefix.substring(0, prefix.length() - 1)) .map(InterledgerAddressPrefix::of) .collect(Collectors.reducing((a, b) -> { logger.error( "Routing table has more than one longest-match! This should never happen!" ); return null; }) ); } } }
|
InterledgerAddressPrefixMap { @VisibleForTesting protected Optional<InterledgerAddressPrefix> findLongestPrefix( final InterledgerAddressPrefix destinationAddressPrefix ) { Objects.requireNonNull(destinationAddressPrefix, "destinationAddressPrefix must not be null!"); String destinationPrefixKey = toTrieKey(destinationAddressPrefix); final SortedMap<String, R> prefixSubMap = filterLongerPrefixes(destinationPrefixKey, prefixMap.prefixMap(destinationPrefixKey)); if (prefixSubMap.isEmpty() && destinationAddressPrefix.hasPrefix()) { return destinationAddressPrefix.getPrefix() .map(parentPrefix -> { final Optional<InterledgerAddressPrefix> longestMatch = this.findLongestPrefix(parentPrefix); if (longestMatch.isPresent()) { return longestMatch; } else { return this.findLongestPrefix(destinationAddressPrefix.getRootPrefix()); } }) .orElse(Optional.empty()); } else { return prefixSubMap.keySet().stream() .filter(val -> val.length() <= (destinationAddressPrefix.getValue().length() + 1)) .distinct() .map(prefix -> prefix.substring(0, prefix.length() - 1)) .map(InterledgerAddressPrefix::of) .collect(Collectors.reducing((a, b) -> { logger.error( "Routing table has more than one longest-match! This should never happen!" ); return null; }) ); } } InterledgerAddressPrefixMap(); }
|
InterledgerAddressPrefixMap { @VisibleForTesting protected Optional<InterledgerAddressPrefix> findLongestPrefix( final InterledgerAddressPrefix destinationAddressPrefix ) { Objects.requireNonNull(destinationAddressPrefix, "destinationAddressPrefix must not be null!"); String destinationPrefixKey = toTrieKey(destinationAddressPrefix); final SortedMap<String, R> prefixSubMap = filterLongerPrefixes(destinationPrefixKey, prefixMap.prefixMap(destinationPrefixKey)); if (prefixSubMap.isEmpty() && destinationAddressPrefix.hasPrefix()) { return destinationAddressPrefix.getPrefix() .map(parentPrefix -> { final Optional<InterledgerAddressPrefix> longestMatch = this.findLongestPrefix(parentPrefix); if (longestMatch.isPresent()) { return longestMatch; } else { return this.findLongestPrefix(destinationAddressPrefix.getRootPrefix()); } }) .orElse(Optional.empty()); } else { return prefixSubMap.keySet().stream() .filter(val -> val.length() <= (destinationAddressPrefix.getValue().length() + 1)) .distinct() .map(prefix -> prefix.substring(0, prefix.length() - 1)) .map(InterledgerAddressPrefix::of) .collect(Collectors.reducing((a, b) -> { logger.error( "Routing table has more than one longest-match! This should never happen!" ); return null; }) ); } } InterledgerAddressPrefixMap(); int getNumKeys(); R putEntry(final InterledgerAddressPrefix addressPrefix, final R entry); Optional<R> removeEntry(final InterledgerAddressPrefix addressPrefix); void reset(); Optional<R> getEntry(final InterledgerAddressPrefix addressPrefix); Set<InterledgerAddressPrefix> getKeys(); void forEach(final BiConsumer<? super InterledgerAddressPrefix, R> action); Optional<R> findNextHop(final InterledgerAddress finalDestinationAddress); }
|
InterledgerAddressPrefixMap { @VisibleForTesting protected Optional<InterledgerAddressPrefix> findLongestPrefix( final InterledgerAddressPrefix destinationAddressPrefix ) { Objects.requireNonNull(destinationAddressPrefix, "destinationAddressPrefix must not be null!"); String destinationPrefixKey = toTrieKey(destinationAddressPrefix); final SortedMap<String, R> prefixSubMap = filterLongerPrefixes(destinationPrefixKey, prefixMap.prefixMap(destinationPrefixKey)); if (prefixSubMap.isEmpty() && destinationAddressPrefix.hasPrefix()) { return destinationAddressPrefix.getPrefix() .map(parentPrefix -> { final Optional<InterledgerAddressPrefix> longestMatch = this.findLongestPrefix(parentPrefix); if (longestMatch.isPresent()) { return longestMatch; } else { return this.findLongestPrefix(destinationAddressPrefix.getRootPrefix()); } }) .orElse(Optional.empty()); } else { return prefixSubMap.keySet().stream() .filter(val -> val.length() <= (destinationAddressPrefix.getValue().length() + 1)) .distinct() .map(prefix -> prefix.substring(0, prefix.length() - 1)) .map(InterledgerAddressPrefix::of) .collect(Collectors.reducing((a, b) -> { logger.error( "Routing table has more than one longest-match! This should never happen!" ); return null; }) ); } } InterledgerAddressPrefixMap(); int getNumKeys(); R putEntry(final InterledgerAddressPrefix addressPrefix, final R entry); Optional<R> removeEntry(final InterledgerAddressPrefix addressPrefix); void reset(); Optional<R> getEntry(final InterledgerAddressPrefix addressPrefix); Set<InterledgerAddressPrefix> getKeys(); void forEach(final BiConsumer<? super InterledgerAddressPrefix, R> action); Optional<R> findNextHop(final InterledgerAddress finalDestinationAddress); }
|
@Test public void testFindLongestPrefix() { this.prefixMap = constructPopulatedPrefixMap(); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.b")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.bo")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.bob")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.b")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.f")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.fool")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.foo.a")).get().getValue()).isEqualTo("g.foo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.foo.b")).get().getValue()).isEqualTo("g.foo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.foo.bo")).get().getValue()).isEqualTo("g.foo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.foo.alice")).get().getValue()).isEqualTo("g.foo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.foo.bob")).get().getValue()).isEqualTo("g.foo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.foo.foo")).get().getValue()).isEqualTo("g.foo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.foo.bar")).get().getValue()).isEqualTo("g.foo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.foo.fool")).get().getValue()).isEqualTo("g.foo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.bar.a")).get().getValue()).isEqualTo("g.bar"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.bar.b")).get().getValue()).isEqualTo("g.bar"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.bar.bo")).get().getValue()).isEqualTo("g.bar"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.bar.alice")).get().getValue()).isEqualTo("g.bar"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.bar.bob")).get().getValue()).isEqualTo("g.bar"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.bar.foo")).get().getValue()).isEqualTo("g.bar"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.bart")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.boo.a")).get().getValue()).isEqualTo("g.baz.boo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.boo.b")).get().getValue()).isEqualTo("g.baz.boo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.boo.bo")).get().getValue()).isEqualTo("g.baz.boo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.boo.alice")).get().getValue()).isEqualTo("g.baz.boo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.boo.bob")).get().getValue()).isEqualTo("g.baz.boo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.boo.foo")).get().getValue()).isEqualTo("g.baz.boo"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.bool")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.bazl")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.boo.bar.a")).get().getValue()).isEqualTo("g.baz.boo.bar"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.boo.bar.b")).get().getValue()).isEqualTo("g.baz.boo.bar"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.boo.bar.bo")).get().getValue()).isEqualTo("g.baz.boo.bar"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.boo.bar.alice")).get().getValue()).isEqualTo("g.baz.boo.bar"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.boo.bar.bob")).get().getValue()).isEqualTo("g.baz.boo.bar"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.boo.bar.foo")).get().getValue()).isEqualTo("g.baz.boo.bar"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.baz.bool.bart")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.bazl.boo.bar")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.notfound.a")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.notfound.b")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.notfound.bo")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.notfound.alice")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.notfound.bob")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.notfound.foo")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.1.b")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.1.bo")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.1.bob")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.1.b")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.1.f")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.1.foo")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.11")).get().getValue()).isEqualTo("g"); assertThat(prefixMap.findLongestPrefix(InterledgerAddressPrefix.of("g.22")).get().getValue()).isEqualTo("g"); }
|
@VisibleForTesting protected Optional<InterledgerAddressPrefix> findLongestPrefix( final InterledgerAddressPrefix destinationAddressPrefix ) { Objects.requireNonNull(destinationAddressPrefix, "destinationAddressPrefix must not be null!"); String destinationPrefixKey = toTrieKey(destinationAddressPrefix); final SortedMap<String, R> prefixSubMap = filterLongerPrefixes(destinationPrefixKey, prefixMap.prefixMap(destinationPrefixKey)); if (prefixSubMap.isEmpty() && destinationAddressPrefix.hasPrefix()) { return destinationAddressPrefix.getPrefix() .map(parentPrefix -> { final Optional<InterledgerAddressPrefix> longestMatch = this.findLongestPrefix(parentPrefix); if (longestMatch.isPresent()) { return longestMatch; } else { return this.findLongestPrefix(destinationAddressPrefix.getRootPrefix()); } }) .orElse(Optional.empty()); } else { return prefixSubMap.keySet().stream() .filter(val -> val.length() <= (destinationAddressPrefix.getValue().length() + 1)) .distinct() .map(prefix -> prefix.substring(0, prefix.length() - 1)) .map(InterledgerAddressPrefix::of) .collect(Collectors.reducing((a, b) -> { logger.error( "Routing table has more than one longest-match! This should never happen!" ); return null; }) ); } }
|
InterledgerAddressPrefixMap { @VisibleForTesting protected Optional<InterledgerAddressPrefix> findLongestPrefix( final InterledgerAddressPrefix destinationAddressPrefix ) { Objects.requireNonNull(destinationAddressPrefix, "destinationAddressPrefix must not be null!"); String destinationPrefixKey = toTrieKey(destinationAddressPrefix); final SortedMap<String, R> prefixSubMap = filterLongerPrefixes(destinationPrefixKey, prefixMap.prefixMap(destinationPrefixKey)); if (prefixSubMap.isEmpty() && destinationAddressPrefix.hasPrefix()) { return destinationAddressPrefix.getPrefix() .map(parentPrefix -> { final Optional<InterledgerAddressPrefix> longestMatch = this.findLongestPrefix(parentPrefix); if (longestMatch.isPresent()) { return longestMatch; } else { return this.findLongestPrefix(destinationAddressPrefix.getRootPrefix()); } }) .orElse(Optional.empty()); } else { return prefixSubMap.keySet().stream() .filter(val -> val.length() <= (destinationAddressPrefix.getValue().length() + 1)) .distinct() .map(prefix -> prefix.substring(0, prefix.length() - 1)) .map(InterledgerAddressPrefix::of) .collect(Collectors.reducing((a, b) -> { logger.error( "Routing table has more than one longest-match! This should never happen!" ); return null; }) ); } } }
|
InterledgerAddressPrefixMap { @VisibleForTesting protected Optional<InterledgerAddressPrefix> findLongestPrefix( final InterledgerAddressPrefix destinationAddressPrefix ) { Objects.requireNonNull(destinationAddressPrefix, "destinationAddressPrefix must not be null!"); String destinationPrefixKey = toTrieKey(destinationAddressPrefix); final SortedMap<String, R> prefixSubMap = filterLongerPrefixes(destinationPrefixKey, prefixMap.prefixMap(destinationPrefixKey)); if (prefixSubMap.isEmpty() && destinationAddressPrefix.hasPrefix()) { return destinationAddressPrefix.getPrefix() .map(parentPrefix -> { final Optional<InterledgerAddressPrefix> longestMatch = this.findLongestPrefix(parentPrefix); if (longestMatch.isPresent()) { return longestMatch; } else { return this.findLongestPrefix(destinationAddressPrefix.getRootPrefix()); } }) .orElse(Optional.empty()); } else { return prefixSubMap.keySet().stream() .filter(val -> val.length() <= (destinationAddressPrefix.getValue().length() + 1)) .distinct() .map(prefix -> prefix.substring(0, prefix.length() - 1)) .map(InterledgerAddressPrefix::of) .collect(Collectors.reducing((a, b) -> { logger.error( "Routing table has more than one longest-match! This should never happen!" ); return null; }) ); } } InterledgerAddressPrefixMap(); }
|
InterledgerAddressPrefixMap { @VisibleForTesting protected Optional<InterledgerAddressPrefix> findLongestPrefix( final InterledgerAddressPrefix destinationAddressPrefix ) { Objects.requireNonNull(destinationAddressPrefix, "destinationAddressPrefix must not be null!"); String destinationPrefixKey = toTrieKey(destinationAddressPrefix); final SortedMap<String, R> prefixSubMap = filterLongerPrefixes(destinationPrefixKey, prefixMap.prefixMap(destinationPrefixKey)); if (prefixSubMap.isEmpty() && destinationAddressPrefix.hasPrefix()) { return destinationAddressPrefix.getPrefix() .map(parentPrefix -> { final Optional<InterledgerAddressPrefix> longestMatch = this.findLongestPrefix(parentPrefix); if (longestMatch.isPresent()) { return longestMatch; } else { return this.findLongestPrefix(destinationAddressPrefix.getRootPrefix()); } }) .orElse(Optional.empty()); } else { return prefixSubMap.keySet().stream() .filter(val -> val.length() <= (destinationAddressPrefix.getValue().length() + 1)) .distinct() .map(prefix -> prefix.substring(0, prefix.length() - 1)) .map(InterledgerAddressPrefix::of) .collect(Collectors.reducing((a, b) -> { logger.error( "Routing table has more than one longest-match! This should never happen!" ); return null; }) ); } } InterledgerAddressPrefixMap(); int getNumKeys(); R putEntry(final InterledgerAddressPrefix addressPrefix, final R entry); Optional<R> removeEntry(final InterledgerAddressPrefix addressPrefix); void reset(); Optional<R> getEntry(final InterledgerAddressPrefix addressPrefix); Set<InterledgerAddressPrefix> getKeys(); void forEach(final BiConsumer<? super InterledgerAddressPrefix, R> action); Optional<R> findNextHop(final InterledgerAddress finalDestinationAddress); }
|
InterledgerAddressPrefixMap { @VisibleForTesting protected Optional<InterledgerAddressPrefix> findLongestPrefix( final InterledgerAddressPrefix destinationAddressPrefix ) { Objects.requireNonNull(destinationAddressPrefix, "destinationAddressPrefix must not be null!"); String destinationPrefixKey = toTrieKey(destinationAddressPrefix); final SortedMap<String, R> prefixSubMap = filterLongerPrefixes(destinationPrefixKey, prefixMap.prefixMap(destinationPrefixKey)); if (prefixSubMap.isEmpty() && destinationAddressPrefix.hasPrefix()) { return destinationAddressPrefix.getPrefix() .map(parentPrefix -> { final Optional<InterledgerAddressPrefix> longestMatch = this.findLongestPrefix(parentPrefix); if (longestMatch.isPresent()) { return longestMatch; } else { return this.findLongestPrefix(destinationAddressPrefix.getRootPrefix()); } }) .orElse(Optional.empty()); } else { return prefixSubMap.keySet().stream() .filter(val -> val.length() <= (destinationAddressPrefix.getValue().length() + 1)) .distinct() .map(prefix -> prefix.substring(0, prefix.length() - 1)) .map(InterledgerAddressPrefix::of) .collect(Collectors.reducing((a, b) -> { logger.error( "Routing table has more than one longest-match! This should never happen!" ); return null; }) ); } } InterledgerAddressPrefixMap(); int getNumKeys(); R putEntry(final InterledgerAddressPrefix addressPrefix, final R entry); Optional<R> removeEntry(final InterledgerAddressPrefix addressPrefix); void reset(); Optional<R> getEntry(final InterledgerAddressPrefix addressPrefix); Set<InterledgerAddressPrefix> getKeys(); void forEach(final BiConsumer<? super InterledgerAddressPrefix, R> action); Optional<R> findNextHop(final InterledgerAddress finalDestinationAddress); }
|
@Test(expected = NullPointerException.class) public void testAddRouteNull() { try { this.routingTable.addRoute(null); } catch (NullPointerException e) { throw e; } }
|
@Override public R addRoute(final R route) { Objects.requireNonNull(route); return this.interledgerAddressPrefixMap.putEntry(route.routePrefix(), route); }
|
InMemoryRoutingTable implements RoutingTable<R> { @Override public R addRoute(final R route) { Objects.requireNonNull(route); return this.interledgerAddressPrefixMap.putEntry(route.routePrefix(), route); } }
|
InMemoryRoutingTable implements RoutingTable<R> { @Override public R addRoute(final R route) { Objects.requireNonNull(route); return this.interledgerAddressPrefixMap.putEntry(route.routePrefix(), route); } InMemoryRoutingTable(); InMemoryRoutingTable(final InterledgerAddressPrefixMap interledgerAddressPrefixMap); }
|
InMemoryRoutingTable implements RoutingTable<R> { @Override public R addRoute(final R route) { Objects.requireNonNull(route); return this.interledgerAddressPrefixMap.putEntry(route.routePrefix(), route); } InMemoryRoutingTable(); InMemoryRoutingTable(final InterledgerAddressPrefixMap interledgerAddressPrefixMap); @Override R addRoute(final R route); @Override Optional<R> removeRoute(final InterledgerAddressPrefix addressPrefix); @Override Optional<R> getRouteByPrefix(final InterledgerAddressPrefix addressPrefix); @Override Iterable<InterledgerAddressPrefix> getAllPrefixes(); @Override void forEach(final BiConsumer<InterledgerAddressPrefix, R> action); @Override Optional<R> findNextHopRoute(final InterledgerAddress interledgerAddress); @Override void reset(); }
|
InMemoryRoutingTable implements RoutingTable<R> { @Override public R addRoute(final R route) { Objects.requireNonNull(route); return this.interledgerAddressPrefixMap.putEntry(route.routePrefix(), route); } InMemoryRoutingTable(); InMemoryRoutingTable(final InterledgerAddressPrefixMap interledgerAddressPrefixMap); @Override R addRoute(final R route); @Override Optional<R> removeRoute(final InterledgerAddressPrefix addressPrefix); @Override Optional<R> getRouteByPrefix(final InterledgerAddressPrefix addressPrefix); @Override Iterable<InterledgerAddressPrefix> getAllPrefixes(); @Override void forEach(final BiConsumer<InterledgerAddressPrefix, R> action); @Override Optional<R> findNextHopRoute(final InterledgerAddress interledgerAddress); @Override void reset(); }
|
@Test public void testAddRoute() { final Route route = this.constructTestRoute(GLOBAL_PREFIX); this.routingTable.addRoute(route); verify(interledgerPrefixMapMock).putEntry(route.routePrefix(), route); verifyNoMoreInteractions(interledgerPrefixMapMock); }
|
@Override public R addRoute(final R route) { Objects.requireNonNull(route); return this.interledgerAddressPrefixMap.putEntry(route.routePrefix(), route); }
|
InMemoryRoutingTable implements RoutingTable<R> { @Override public R addRoute(final R route) { Objects.requireNonNull(route); return this.interledgerAddressPrefixMap.putEntry(route.routePrefix(), route); } }
|
InMemoryRoutingTable implements RoutingTable<R> { @Override public R addRoute(final R route) { Objects.requireNonNull(route); return this.interledgerAddressPrefixMap.putEntry(route.routePrefix(), route); } InMemoryRoutingTable(); InMemoryRoutingTable(final InterledgerAddressPrefixMap interledgerAddressPrefixMap); }
|
InMemoryRoutingTable implements RoutingTable<R> { @Override public R addRoute(final R route) { Objects.requireNonNull(route); return this.interledgerAddressPrefixMap.putEntry(route.routePrefix(), route); } InMemoryRoutingTable(); InMemoryRoutingTable(final InterledgerAddressPrefixMap interledgerAddressPrefixMap); @Override R addRoute(final R route); @Override Optional<R> removeRoute(final InterledgerAddressPrefix addressPrefix); @Override Optional<R> getRouteByPrefix(final InterledgerAddressPrefix addressPrefix); @Override Iterable<InterledgerAddressPrefix> getAllPrefixes(); @Override void forEach(final BiConsumer<InterledgerAddressPrefix, R> action); @Override Optional<R> findNextHopRoute(final InterledgerAddress interledgerAddress); @Override void reset(); }
|
InMemoryRoutingTable implements RoutingTable<R> { @Override public R addRoute(final R route) { Objects.requireNonNull(route); return this.interledgerAddressPrefixMap.putEntry(route.routePrefix(), route); } InMemoryRoutingTable(); InMemoryRoutingTable(final InterledgerAddressPrefixMap interledgerAddressPrefixMap); @Override R addRoute(final R route); @Override Optional<R> removeRoute(final InterledgerAddressPrefix addressPrefix); @Override Optional<R> getRouteByPrefix(final InterledgerAddressPrefix addressPrefix); @Override Iterable<InterledgerAddressPrefix> getAllPrefixes(); @Override void forEach(final BiConsumer<InterledgerAddressPrefix, R> action); @Override Optional<R> findNextHopRoute(final InterledgerAddress interledgerAddress); @Override void reset(); }
|
@Test public void withDecryptedThrowsExceptionIfNoProvider() { DelegatingEncryptionService service = new DelegatingEncryptionService(Sets.newHashSet(mockJks)); expectedException.expect(RuntimeException.class); service.withDecrypted(GCP_SECRET, regurgitate); }
|
@Override public <T> T withDecrypted(EncryptedSecret encryptedSecret, Function<byte[], T> callable) { return getDelegate(encryptedSecret.keyMetadata()).withDecrypted(encryptedSecret, callable); }
|
DelegatingEncryptionService implements EncryptionService { @Override public <T> T withDecrypted(EncryptedSecret encryptedSecret, Function<byte[], T> callable) { return getDelegate(encryptedSecret.keyMetadata()).withDecrypted(encryptedSecret, callable); } }
|
DelegatingEncryptionService implements EncryptionService { @Override public <T> T withDecrypted(EncryptedSecret encryptedSecret, Function<byte[], T> callable) { return getDelegate(encryptedSecret.keyMetadata()).withDecrypted(encryptedSecret, callable); } DelegatingEncryptionService(final Set<EncryptionService> encryptionServices); }
|
DelegatingEncryptionService implements EncryptionService { @Override public <T> T withDecrypted(EncryptedSecret encryptedSecret, Function<byte[], T> callable) { return getDelegate(encryptedSecret.keyMetadata()).withDecrypted(encryptedSecret, callable); } DelegatingEncryptionService(final Set<EncryptionService> encryptionServices); @Override KeyStoreType keyStoreType(); @Override byte[] decrypt(KeyMetadata keyMetadata, EncryptionAlgorithm encryptionAlgorithm, byte[] cipherMessage); @Override EncryptedSecret encrypt(KeyMetadata keyMetadata, EncryptionAlgorithm encryptionAlgorithm, byte[] plainText); @Override T withDecrypted(EncryptedSecret encryptedSecret, Function<byte[], T> callable); }
|
DelegatingEncryptionService implements EncryptionService { @Override public <T> T withDecrypted(EncryptedSecret encryptedSecret, Function<byte[], T> callable) { return getDelegate(encryptedSecret.keyMetadata()).withDecrypted(encryptedSecret, callable); } DelegatingEncryptionService(final Set<EncryptionService> encryptionServices); @Override KeyStoreType keyStoreType(); @Override byte[] decrypt(KeyMetadata keyMetadata, EncryptionAlgorithm encryptionAlgorithm, byte[] cipherMessage); @Override EncryptedSecret encrypt(KeyMetadata keyMetadata, EncryptionAlgorithm encryptionAlgorithm, byte[] plainText); @Override T withDecrypted(EncryptedSecret encryptedSecret, Function<byte[], T> callable); }
|
@Test public void saveResIdAsHeaderTitle() { assertThat(subject.getHeaderTitle(), is(TEST_HEADER)); }
|
public int getHeaderTitle() { return headerTitle; }
|
AttractionCollection { public int getHeaderTitle() { return headerTitle; } }
|
AttractionCollection { public int getHeaderTitle() { return headerTitle; } AttractionCollection(int headerTextResId, List<Attraction> listOfAttractions); }
|
AttractionCollection { public int getHeaderTitle() { return headerTitle; } AttractionCollection(int headerTextResId, List<Attraction> listOfAttractions); int getHeaderTitle(); List<Attraction> getAttractions(); }
|
AttractionCollection { public int getHeaderTitle() { return headerTitle; } AttractionCollection(int headerTextResId, List<Attraction> listOfAttractions); int getHeaderTitle(); List<Attraction> getAttractions(); }
|
@Test public void saveAsAttractionCollection_buildNightLifeCollection() { assertThat(AttractionRepository.buildNightLifeCollection(), instanceOf(AttractionCollection.class)); }
|
@VisibleForTesting static AttractionCollection buildNightLifeCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.social, R.string.social_title, R.string.creative_cocktails, R.string.social_detailed_desc, R.string.mq_social ) ); attractions.add(new Attraction( R.drawable.mayor_old_town, R.string.mayor_old_town_title, R.string.mayor_great_selction, R.string.mayor_of_old_town_detailed_desc, R.string.mq_mayor_old_town ) ); attractions.add(new Attraction( R.drawable.colorado_room, R.string.colorado_room_title, R.string.colorado_beers_and_spirits, R.string.the_colorado_room_detailed_desc, R.string.mq_the_colorado_room ) ); attractions.add(new Attraction( R.drawable.ace_gilletts, R.string.ace_gilletts_title, R.string.gilletts_crafted_beers, R.string.ace_gilletts_detailed_desc, R.string.mq_ace_gilletts ) ); attractions.add(new Attraction( R.drawable.elliot_martini_bar, R.string.elliots_martini_title, R.string.elliot_martini_variety, R.string.elliot_martini_bar_detailed_desc, R.string.mq_elliot_martini_bar ) ); return new AttractionCollection(R.string.top_bars_nightlife, attractions); }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildNightLifeCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.social, R.string.social_title, R.string.creative_cocktails, R.string.social_detailed_desc, R.string.mq_social ) ); attractions.add(new Attraction( R.drawable.mayor_old_town, R.string.mayor_old_town_title, R.string.mayor_great_selction, R.string.mayor_of_old_town_detailed_desc, R.string.mq_mayor_old_town ) ); attractions.add(new Attraction( R.drawable.colorado_room, R.string.colorado_room_title, R.string.colorado_beers_and_spirits, R.string.the_colorado_room_detailed_desc, R.string.mq_the_colorado_room ) ); attractions.add(new Attraction( R.drawable.ace_gilletts, R.string.ace_gilletts_title, R.string.gilletts_crafted_beers, R.string.ace_gilletts_detailed_desc, R.string.mq_ace_gilletts ) ); attractions.add(new Attraction( R.drawable.elliot_martini_bar, R.string.elliots_martini_title, R.string.elliot_martini_variety, R.string.elliot_martini_bar_detailed_desc, R.string.mq_elliot_martini_bar ) ); return new AttractionCollection(R.string.top_bars_nightlife, attractions); } }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildNightLifeCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.social, R.string.social_title, R.string.creative_cocktails, R.string.social_detailed_desc, R.string.mq_social ) ); attractions.add(new Attraction( R.drawable.mayor_old_town, R.string.mayor_old_town_title, R.string.mayor_great_selction, R.string.mayor_of_old_town_detailed_desc, R.string.mq_mayor_old_town ) ); attractions.add(new Attraction( R.drawable.colorado_room, R.string.colorado_room_title, R.string.colorado_beers_and_spirits, R.string.the_colorado_room_detailed_desc, R.string.mq_the_colorado_room ) ); attractions.add(new Attraction( R.drawable.ace_gilletts, R.string.ace_gilletts_title, R.string.gilletts_crafted_beers, R.string.ace_gilletts_detailed_desc, R.string.mq_ace_gilletts ) ); attractions.add(new Attraction( R.drawable.elliot_martini_bar, R.string.elliots_martini_title, R.string.elliot_martini_variety, R.string.elliot_martini_bar_detailed_desc, R.string.mq_elliot_martini_bar ) ); return new AttractionCollection(R.string.top_bars_nightlife, attractions); } private AttractionRepository(Context context); }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildNightLifeCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.social, R.string.social_title, R.string.creative_cocktails, R.string.social_detailed_desc, R.string.mq_social ) ); attractions.add(new Attraction( R.drawable.mayor_old_town, R.string.mayor_old_town_title, R.string.mayor_great_selction, R.string.mayor_of_old_town_detailed_desc, R.string.mq_mayor_old_town ) ); attractions.add(new Attraction( R.drawable.colorado_room, R.string.colorado_room_title, R.string.colorado_beers_and_spirits, R.string.the_colorado_room_detailed_desc, R.string.mq_the_colorado_room ) ); attractions.add(new Attraction( R.drawable.ace_gilletts, R.string.ace_gilletts_title, R.string.gilletts_crafted_beers, R.string.ace_gilletts_detailed_desc, R.string.mq_ace_gilletts ) ); attractions.add(new Attraction( R.drawable.elliot_martini_bar, R.string.elliots_martini_title, R.string.elliot_martini_variety, R.string.elliot_martini_bar_detailed_desc, R.string.mq_elliot_martini_bar ) ); return new AttractionCollection(R.string.top_bars_nightlife, attractions); } private AttractionRepository(Context context); static AttractionRepository getInstance(Context packageContext); AttractionCollection getCollection(int sectionTitle); List<AttractionCollection> getCollections(); }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildNightLifeCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.social, R.string.social_title, R.string.creative_cocktails, R.string.social_detailed_desc, R.string.mq_social ) ); attractions.add(new Attraction( R.drawable.mayor_old_town, R.string.mayor_old_town_title, R.string.mayor_great_selction, R.string.mayor_of_old_town_detailed_desc, R.string.mq_mayor_old_town ) ); attractions.add(new Attraction( R.drawable.colorado_room, R.string.colorado_room_title, R.string.colorado_beers_and_spirits, R.string.the_colorado_room_detailed_desc, R.string.mq_the_colorado_room ) ); attractions.add(new Attraction( R.drawable.ace_gilletts, R.string.ace_gilletts_title, R.string.gilletts_crafted_beers, R.string.ace_gilletts_detailed_desc, R.string.mq_ace_gilletts ) ); attractions.add(new Attraction( R.drawable.elliot_martini_bar, R.string.elliots_martini_title, R.string.elliot_martini_variety, R.string.elliot_martini_bar_detailed_desc, R.string.mq_elliot_martini_bar ) ); return new AttractionCollection(R.string.top_bars_nightlife, attractions); } private AttractionRepository(Context context); static AttractionRepository getInstance(Context packageContext); AttractionCollection getCollection(int sectionTitle); List<AttractionCollection> getCollections(); }
|
@Test public void savesAttractionType_getAttractions() { assertThat(subject.getAttractions().get(0), isA(Attraction.class)); }
|
public List<Attraction> getAttractions() { return listOfAttractions; }
|
AttractionCollection { public List<Attraction> getAttractions() { return listOfAttractions; } }
|
AttractionCollection { public List<Attraction> getAttractions() { return listOfAttractions; } AttractionCollection(int headerTextResId, List<Attraction> listOfAttractions); }
|
AttractionCollection { public List<Attraction> getAttractions() { return listOfAttractions; } AttractionCollection(int headerTextResId, List<Attraction> listOfAttractions); int getHeaderTitle(); List<Attraction> getAttractions(); }
|
AttractionCollection { public List<Attraction> getAttractions() { return listOfAttractions; } AttractionCollection(int headerTextResId, List<Attraction> listOfAttractions); int getHeaderTitle(); List<Attraction> getAttractions(); }
|
@Test public void returnsAList_getAttractions() { assertThat(subject.getAttractions(), instanceOf(List.class)); }
|
public List<Attraction> getAttractions() { return listOfAttractions; }
|
AttractionCollection { public List<Attraction> getAttractions() { return listOfAttractions; } }
|
AttractionCollection { public List<Attraction> getAttractions() { return listOfAttractions; } AttractionCollection(int headerTextResId, List<Attraction> listOfAttractions); }
|
AttractionCollection { public List<Attraction> getAttractions() { return listOfAttractions; } AttractionCollection(int headerTextResId, List<Attraction> listOfAttractions); int getHeaderTitle(); List<Attraction> getAttractions(); }
|
AttractionCollection { public List<Attraction> getAttractions() { return listOfAttractions; } AttractionCollection(int headerTextResId, List<Attraction> listOfAttractions); int getHeaderTitle(); List<Attraction> getAttractions(); }
|
@Test public void storesResIdForImage() { assertThat(subject.getImageResourceId(), is(TEST_IMAGE)); }
|
public int getImageResourceId() { return imageResourceId; }
|
Attraction implements Parcelable { public int getImageResourceId() { return imageResourceId; } }
|
Attraction implements Parcelable { public int getImageResourceId() { return imageResourceId; } Attraction(int imageResourceId, int titleTextResId, int shortDescTextResId,
int longDescTextResId, int mapQueryStrId); protected Attraction(Parcel in); }
|
Attraction implements Parcelable { public int getImageResourceId() { return imageResourceId; } Attraction(int imageResourceId, int titleTextResId, int shortDescTextResId,
int longDescTextResId, int mapQueryStrId); protected Attraction(Parcel in); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); int getImageResourceId(); int getTitle(); int getShortDesc(); int getLongDesc(); int getMapQueryStrId(); }
|
Attraction implements Parcelable { public int getImageResourceId() { return imageResourceId; } Attraction(int imageResourceId, int titleTextResId, int shortDescTextResId,
int longDescTextResId, int mapQueryStrId); protected Attraction(Parcel in); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); int getImageResourceId(); int getTitle(); int getShortDesc(); int getLongDesc(); int getMapQueryStrId(); static final Creator<Attraction> CREATOR; }
|
@Test public void storesResIdAsTitle() { assertThat(subject.getTitle(), is(TEST_TITLE)); }
|
public int getTitle() { return titleTextResId; }
|
Attraction implements Parcelable { public int getTitle() { return titleTextResId; } }
|
Attraction implements Parcelable { public int getTitle() { return titleTextResId; } Attraction(int imageResourceId, int titleTextResId, int shortDescTextResId,
int longDescTextResId, int mapQueryStrId); protected Attraction(Parcel in); }
|
Attraction implements Parcelable { public int getTitle() { return titleTextResId; } Attraction(int imageResourceId, int titleTextResId, int shortDescTextResId,
int longDescTextResId, int mapQueryStrId); protected Attraction(Parcel in); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); int getImageResourceId(); int getTitle(); int getShortDesc(); int getLongDesc(); int getMapQueryStrId(); }
|
Attraction implements Parcelable { public int getTitle() { return titleTextResId; } Attraction(int imageResourceId, int titleTextResId, int shortDescTextResId,
int longDescTextResId, int mapQueryStrId); protected Attraction(Parcel in); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); int getImageResourceId(); int getTitle(); int getShortDesc(); int getLongDesc(); int getMapQueryStrId(); static final Creator<Attraction> CREATOR; }
|
@Test public void storesResIdAsShortDesc() { assertThat(subject.getShortDesc(), is(TEST_SHORT_DESC)); }
|
public int getShortDesc() { return shortDescTextResId; }
|
Attraction implements Parcelable { public int getShortDesc() { return shortDescTextResId; } }
|
Attraction implements Parcelable { public int getShortDesc() { return shortDescTextResId; } Attraction(int imageResourceId, int titleTextResId, int shortDescTextResId,
int longDescTextResId, int mapQueryStrId); protected Attraction(Parcel in); }
|
Attraction implements Parcelable { public int getShortDesc() { return shortDescTextResId; } Attraction(int imageResourceId, int titleTextResId, int shortDescTextResId,
int longDescTextResId, int mapQueryStrId); protected Attraction(Parcel in); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); int getImageResourceId(); int getTitle(); int getShortDesc(); int getLongDesc(); int getMapQueryStrId(); }
|
Attraction implements Parcelable { public int getShortDesc() { return shortDescTextResId; } Attraction(int imageResourceId, int titleTextResId, int shortDescTextResId,
int longDescTextResId, int mapQueryStrId); protected Attraction(Parcel in); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); int getImageResourceId(); int getTitle(); int getShortDesc(); int getLongDesc(); int getMapQueryStrId(); static final Creator<Attraction> CREATOR; }
|
@Test public void storesResIdAsLongDesc() { assertThat(subject.getLongDesc(), is(TEST_LONG_DESC)); }
|
public int getLongDesc() { return longDescTextResId; }
|
Attraction implements Parcelable { public int getLongDesc() { return longDescTextResId; } }
|
Attraction implements Parcelable { public int getLongDesc() { return longDescTextResId; } Attraction(int imageResourceId, int titleTextResId, int shortDescTextResId,
int longDescTextResId, int mapQueryStrId); protected Attraction(Parcel in); }
|
Attraction implements Parcelable { public int getLongDesc() { return longDescTextResId; } Attraction(int imageResourceId, int titleTextResId, int shortDescTextResId,
int longDescTextResId, int mapQueryStrId); protected Attraction(Parcel in); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); int getImageResourceId(); int getTitle(); int getShortDesc(); int getLongDesc(); int getMapQueryStrId(); }
|
Attraction implements Parcelable { public int getLongDesc() { return longDescTextResId; } Attraction(int imageResourceId, int titleTextResId, int shortDescTextResId,
int longDescTextResId, int mapQueryStrId); protected Attraction(Parcel in); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); int getImageResourceId(); int getTitle(); int getShortDesc(); int getLongDesc(); int getMapQueryStrId(); static final Creator<Attraction> CREATOR; }
|
@Test public void saveAsAttractionCollection_buildActivityCollection() { assertThat(AttractionRepository.buildActivityCollection(), instanceOf(AttractionCollection.class)); }
|
@VisibleForTesting static AttractionCollection buildActivityCollection() { List<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.horsetooth_mountain_park, R.string.horsetooth_mountain_title, R.string.scenic_open_space, R.string.horsetooth_mountain_park_detailed_desc, R.string.mq_horestooth_mountain_park ) ); attractions.add(new Attraction( R.drawable.whitewater_rafting, R.string.mountain_whitewater_title, R.string.white_water_rafting, R.string.mountain_whitewater_descents_detailed_desc, R.string.mq_mountain_whitewater ) ); attractions.add(new Attraction( R.drawable.flower_trail_garden, R.string.flower_trial_garden_title, R.string.horticulture_display, R.string.flower_trail_garden_detailed_desc, R.string.mq_annual_flower_trial_garden ) ); attractions.add(new Attraction( R.drawable.horsetooth_reservoir, R.string.horsetooth_reservoir_title, R.string.best_outdoors, R.string.horsetooth_reservoir_detailed_desc, R.string.mq_horestooth_reservoir ) ); attractions.add(new Attraction( R.drawable.city_park, R.string.city_park_title, R.string.ideal_relaxing_spot, R.string.city_park_detailed_desc, R.string.mq_city_park ) ); return new AttractionCollection(R.string.top_activities, attractions); }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildActivityCollection() { List<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.horsetooth_mountain_park, R.string.horsetooth_mountain_title, R.string.scenic_open_space, R.string.horsetooth_mountain_park_detailed_desc, R.string.mq_horestooth_mountain_park ) ); attractions.add(new Attraction( R.drawable.whitewater_rafting, R.string.mountain_whitewater_title, R.string.white_water_rafting, R.string.mountain_whitewater_descents_detailed_desc, R.string.mq_mountain_whitewater ) ); attractions.add(new Attraction( R.drawable.flower_trail_garden, R.string.flower_trial_garden_title, R.string.horticulture_display, R.string.flower_trail_garden_detailed_desc, R.string.mq_annual_flower_trial_garden ) ); attractions.add(new Attraction( R.drawable.horsetooth_reservoir, R.string.horsetooth_reservoir_title, R.string.best_outdoors, R.string.horsetooth_reservoir_detailed_desc, R.string.mq_horestooth_reservoir ) ); attractions.add(new Attraction( R.drawable.city_park, R.string.city_park_title, R.string.ideal_relaxing_spot, R.string.city_park_detailed_desc, R.string.mq_city_park ) ); return new AttractionCollection(R.string.top_activities, attractions); } }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildActivityCollection() { List<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.horsetooth_mountain_park, R.string.horsetooth_mountain_title, R.string.scenic_open_space, R.string.horsetooth_mountain_park_detailed_desc, R.string.mq_horestooth_mountain_park ) ); attractions.add(new Attraction( R.drawable.whitewater_rafting, R.string.mountain_whitewater_title, R.string.white_water_rafting, R.string.mountain_whitewater_descents_detailed_desc, R.string.mq_mountain_whitewater ) ); attractions.add(new Attraction( R.drawable.flower_trail_garden, R.string.flower_trial_garden_title, R.string.horticulture_display, R.string.flower_trail_garden_detailed_desc, R.string.mq_annual_flower_trial_garden ) ); attractions.add(new Attraction( R.drawable.horsetooth_reservoir, R.string.horsetooth_reservoir_title, R.string.best_outdoors, R.string.horsetooth_reservoir_detailed_desc, R.string.mq_horestooth_reservoir ) ); attractions.add(new Attraction( R.drawable.city_park, R.string.city_park_title, R.string.ideal_relaxing_spot, R.string.city_park_detailed_desc, R.string.mq_city_park ) ); return new AttractionCollection(R.string.top_activities, attractions); } private AttractionRepository(Context context); }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildActivityCollection() { List<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.horsetooth_mountain_park, R.string.horsetooth_mountain_title, R.string.scenic_open_space, R.string.horsetooth_mountain_park_detailed_desc, R.string.mq_horestooth_mountain_park ) ); attractions.add(new Attraction( R.drawable.whitewater_rafting, R.string.mountain_whitewater_title, R.string.white_water_rafting, R.string.mountain_whitewater_descents_detailed_desc, R.string.mq_mountain_whitewater ) ); attractions.add(new Attraction( R.drawable.flower_trail_garden, R.string.flower_trial_garden_title, R.string.horticulture_display, R.string.flower_trail_garden_detailed_desc, R.string.mq_annual_flower_trial_garden ) ); attractions.add(new Attraction( R.drawable.horsetooth_reservoir, R.string.horsetooth_reservoir_title, R.string.best_outdoors, R.string.horsetooth_reservoir_detailed_desc, R.string.mq_horestooth_reservoir ) ); attractions.add(new Attraction( R.drawable.city_park, R.string.city_park_title, R.string.ideal_relaxing_spot, R.string.city_park_detailed_desc, R.string.mq_city_park ) ); return new AttractionCollection(R.string.top_activities, attractions); } private AttractionRepository(Context context); static AttractionRepository getInstance(Context packageContext); AttractionCollection getCollection(int sectionTitle); List<AttractionCollection> getCollections(); }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildActivityCollection() { List<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.horsetooth_mountain_park, R.string.horsetooth_mountain_title, R.string.scenic_open_space, R.string.horsetooth_mountain_park_detailed_desc, R.string.mq_horestooth_mountain_park ) ); attractions.add(new Attraction( R.drawable.whitewater_rafting, R.string.mountain_whitewater_title, R.string.white_water_rafting, R.string.mountain_whitewater_descents_detailed_desc, R.string.mq_mountain_whitewater ) ); attractions.add(new Attraction( R.drawable.flower_trail_garden, R.string.flower_trial_garden_title, R.string.horticulture_display, R.string.flower_trail_garden_detailed_desc, R.string.mq_annual_flower_trial_garden ) ); attractions.add(new Attraction( R.drawable.horsetooth_reservoir, R.string.horsetooth_reservoir_title, R.string.best_outdoors, R.string.horsetooth_reservoir_detailed_desc, R.string.mq_horestooth_reservoir ) ); attractions.add(new Attraction( R.drawable.city_park, R.string.city_park_title, R.string.ideal_relaxing_spot, R.string.city_park_detailed_desc, R.string.mq_city_park ) ); return new AttractionCollection(R.string.top_activities, attractions); } private AttractionRepository(Context context); static AttractionRepository getInstance(Context packageContext); AttractionCollection getCollection(int sectionTitle); List<AttractionCollection> getCollections(); }
|
@Test public void saveAsAttractionCollection_buildRestaurantsCollection() { assertThat(AttractionRepository.buildRestaurantsCollection(), instanceOf(AttractionCollection.class)); }
|
@VisibleForTesting static AttractionCollection buildRestaurantsCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.the_melting_pot, R.string.melting_pot_title, R.string.amazing_fondue, R.string.the_melting_pot_detailed_desc, R.string.mq_the_melting_pot ) ); attractions.add(new Attraction( R.drawable.maza_kabob, R.string.maza_kabob_title, R.string.afghan_specialty, R.string.maza_kabob_detailed_desc, R.string.mq_maza_kabob ) ); attractions.add(new Attraction( R.drawable.rio_grande, R.string.rio_grande_title, R.string.amazing_margarita, R.string.rio_grande_detailed_desc, R.string.mq_rio_grande ) ); attractions.add(new Attraction( R.drawable.star_of_india, R.string.star_of_india_title, R.string.indian_buffet, R.string.star_of_india_detailed_desc, R.string.mq_star_of_india ) ); attractions.add(new Attraction( R.drawable.lucile_creole, R.string.lucile_title, R.string.breakfast_place, R.string.lucile_creole_detailed_desc, R.string.mq_lucile ) ); attractions.add(new Attraction( R.drawable.cafe_athens, R.string.cafe_athens_title, R.string.greek_mediterranean, R.string.cafe_athens_detailed_desc, R.string.mq_cafe_athens ) ); attractions.add(new Attraction( R.drawable.cafe_de_bangkok, R.string.cafe_de_bangkok_title, R.string.traditional_thai, R.string.cafe_de_bangkok_detailed_desc, R.string.mq_cafe_de_bangkok ) ); return new AttractionCollection(R.string.top_restaurants, attractions); }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildRestaurantsCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.the_melting_pot, R.string.melting_pot_title, R.string.amazing_fondue, R.string.the_melting_pot_detailed_desc, R.string.mq_the_melting_pot ) ); attractions.add(new Attraction( R.drawable.maza_kabob, R.string.maza_kabob_title, R.string.afghan_specialty, R.string.maza_kabob_detailed_desc, R.string.mq_maza_kabob ) ); attractions.add(new Attraction( R.drawable.rio_grande, R.string.rio_grande_title, R.string.amazing_margarita, R.string.rio_grande_detailed_desc, R.string.mq_rio_grande ) ); attractions.add(new Attraction( R.drawable.star_of_india, R.string.star_of_india_title, R.string.indian_buffet, R.string.star_of_india_detailed_desc, R.string.mq_star_of_india ) ); attractions.add(new Attraction( R.drawable.lucile_creole, R.string.lucile_title, R.string.breakfast_place, R.string.lucile_creole_detailed_desc, R.string.mq_lucile ) ); attractions.add(new Attraction( R.drawable.cafe_athens, R.string.cafe_athens_title, R.string.greek_mediterranean, R.string.cafe_athens_detailed_desc, R.string.mq_cafe_athens ) ); attractions.add(new Attraction( R.drawable.cafe_de_bangkok, R.string.cafe_de_bangkok_title, R.string.traditional_thai, R.string.cafe_de_bangkok_detailed_desc, R.string.mq_cafe_de_bangkok ) ); return new AttractionCollection(R.string.top_restaurants, attractions); } }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildRestaurantsCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.the_melting_pot, R.string.melting_pot_title, R.string.amazing_fondue, R.string.the_melting_pot_detailed_desc, R.string.mq_the_melting_pot ) ); attractions.add(new Attraction( R.drawable.maza_kabob, R.string.maza_kabob_title, R.string.afghan_specialty, R.string.maza_kabob_detailed_desc, R.string.mq_maza_kabob ) ); attractions.add(new Attraction( R.drawable.rio_grande, R.string.rio_grande_title, R.string.amazing_margarita, R.string.rio_grande_detailed_desc, R.string.mq_rio_grande ) ); attractions.add(new Attraction( R.drawable.star_of_india, R.string.star_of_india_title, R.string.indian_buffet, R.string.star_of_india_detailed_desc, R.string.mq_star_of_india ) ); attractions.add(new Attraction( R.drawable.lucile_creole, R.string.lucile_title, R.string.breakfast_place, R.string.lucile_creole_detailed_desc, R.string.mq_lucile ) ); attractions.add(new Attraction( R.drawable.cafe_athens, R.string.cafe_athens_title, R.string.greek_mediterranean, R.string.cafe_athens_detailed_desc, R.string.mq_cafe_athens ) ); attractions.add(new Attraction( R.drawable.cafe_de_bangkok, R.string.cafe_de_bangkok_title, R.string.traditional_thai, R.string.cafe_de_bangkok_detailed_desc, R.string.mq_cafe_de_bangkok ) ); return new AttractionCollection(R.string.top_restaurants, attractions); } private AttractionRepository(Context context); }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildRestaurantsCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.the_melting_pot, R.string.melting_pot_title, R.string.amazing_fondue, R.string.the_melting_pot_detailed_desc, R.string.mq_the_melting_pot ) ); attractions.add(new Attraction( R.drawable.maza_kabob, R.string.maza_kabob_title, R.string.afghan_specialty, R.string.maza_kabob_detailed_desc, R.string.mq_maza_kabob ) ); attractions.add(new Attraction( R.drawable.rio_grande, R.string.rio_grande_title, R.string.amazing_margarita, R.string.rio_grande_detailed_desc, R.string.mq_rio_grande ) ); attractions.add(new Attraction( R.drawable.star_of_india, R.string.star_of_india_title, R.string.indian_buffet, R.string.star_of_india_detailed_desc, R.string.mq_star_of_india ) ); attractions.add(new Attraction( R.drawable.lucile_creole, R.string.lucile_title, R.string.breakfast_place, R.string.lucile_creole_detailed_desc, R.string.mq_lucile ) ); attractions.add(new Attraction( R.drawable.cafe_athens, R.string.cafe_athens_title, R.string.greek_mediterranean, R.string.cafe_athens_detailed_desc, R.string.mq_cafe_athens ) ); attractions.add(new Attraction( R.drawable.cafe_de_bangkok, R.string.cafe_de_bangkok_title, R.string.traditional_thai, R.string.cafe_de_bangkok_detailed_desc, R.string.mq_cafe_de_bangkok ) ); return new AttractionCollection(R.string.top_restaurants, attractions); } private AttractionRepository(Context context); static AttractionRepository getInstance(Context packageContext); AttractionCollection getCollection(int sectionTitle); List<AttractionCollection> getCollections(); }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildRestaurantsCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.the_melting_pot, R.string.melting_pot_title, R.string.amazing_fondue, R.string.the_melting_pot_detailed_desc, R.string.mq_the_melting_pot ) ); attractions.add(new Attraction( R.drawable.maza_kabob, R.string.maza_kabob_title, R.string.afghan_specialty, R.string.maza_kabob_detailed_desc, R.string.mq_maza_kabob ) ); attractions.add(new Attraction( R.drawable.rio_grande, R.string.rio_grande_title, R.string.amazing_margarita, R.string.rio_grande_detailed_desc, R.string.mq_rio_grande ) ); attractions.add(new Attraction( R.drawable.star_of_india, R.string.star_of_india_title, R.string.indian_buffet, R.string.star_of_india_detailed_desc, R.string.mq_star_of_india ) ); attractions.add(new Attraction( R.drawable.lucile_creole, R.string.lucile_title, R.string.breakfast_place, R.string.lucile_creole_detailed_desc, R.string.mq_lucile ) ); attractions.add(new Attraction( R.drawable.cafe_athens, R.string.cafe_athens_title, R.string.greek_mediterranean, R.string.cafe_athens_detailed_desc, R.string.mq_cafe_athens ) ); attractions.add(new Attraction( R.drawable.cafe_de_bangkok, R.string.cafe_de_bangkok_title, R.string.traditional_thai, R.string.cafe_de_bangkok_detailed_desc, R.string.mq_cafe_de_bangkok ) ); return new AttractionCollection(R.string.top_restaurants, attractions); } private AttractionRepository(Context context); static AttractionRepository getInstance(Context packageContext); AttractionCollection getCollection(int sectionTitle); List<AttractionCollection> getCollections(); }
|
@Test public void saveAsAttractionCollection_buildBreweriesCollection() { assertThat(AttractionRepository.buildBreweriesCollection(), instanceOf(AttractionCollection.class)); }
|
@VisibleForTesting static AttractionCollection buildBreweriesCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.new_belgium, R.string.new_belgium_title, R.string.new_belgium_free_tours, R.string.new_belgium_detailed_desc, R.string.mq_new_belgium ) ); attractions.add(new Attraction( R.drawable.odell_brewing, R.string.odell_brewing_title, R.string.odell_microbrew, R.string.odell_brewing_detailed_desc, R.string.mq_odell_brewing ) ); attractions.add(new Attraction( R.drawable.anheuser_busch, R.string.anheuser_busch_title, R.string.grand_tour, R.string.anheuser_busch_detailed_desc, R.string.mq_anheuser_busch ) ); attractions.add(new Attraction( R.drawable.coopersmith_brewing, R.string.coopersmith_title, R.string.coopersmith_mixed_desc, R.string.coopersmith_detailed_desc, R.string.mq_coopersmith ) ); return new AttractionCollection(R.string.top_breweries, attractions); }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildBreweriesCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.new_belgium, R.string.new_belgium_title, R.string.new_belgium_free_tours, R.string.new_belgium_detailed_desc, R.string.mq_new_belgium ) ); attractions.add(new Attraction( R.drawable.odell_brewing, R.string.odell_brewing_title, R.string.odell_microbrew, R.string.odell_brewing_detailed_desc, R.string.mq_odell_brewing ) ); attractions.add(new Attraction( R.drawable.anheuser_busch, R.string.anheuser_busch_title, R.string.grand_tour, R.string.anheuser_busch_detailed_desc, R.string.mq_anheuser_busch ) ); attractions.add(new Attraction( R.drawable.coopersmith_brewing, R.string.coopersmith_title, R.string.coopersmith_mixed_desc, R.string.coopersmith_detailed_desc, R.string.mq_coopersmith ) ); return new AttractionCollection(R.string.top_breweries, attractions); } }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildBreweriesCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.new_belgium, R.string.new_belgium_title, R.string.new_belgium_free_tours, R.string.new_belgium_detailed_desc, R.string.mq_new_belgium ) ); attractions.add(new Attraction( R.drawable.odell_brewing, R.string.odell_brewing_title, R.string.odell_microbrew, R.string.odell_brewing_detailed_desc, R.string.mq_odell_brewing ) ); attractions.add(new Attraction( R.drawable.anheuser_busch, R.string.anheuser_busch_title, R.string.grand_tour, R.string.anheuser_busch_detailed_desc, R.string.mq_anheuser_busch ) ); attractions.add(new Attraction( R.drawable.coopersmith_brewing, R.string.coopersmith_title, R.string.coopersmith_mixed_desc, R.string.coopersmith_detailed_desc, R.string.mq_coopersmith ) ); return new AttractionCollection(R.string.top_breweries, attractions); } private AttractionRepository(Context context); }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildBreweriesCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.new_belgium, R.string.new_belgium_title, R.string.new_belgium_free_tours, R.string.new_belgium_detailed_desc, R.string.mq_new_belgium ) ); attractions.add(new Attraction( R.drawable.odell_brewing, R.string.odell_brewing_title, R.string.odell_microbrew, R.string.odell_brewing_detailed_desc, R.string.mq_odell_brewing ) ); attractions.add(new Attraction( R.drawable.anheuser_busch, R.string.anheuser_busch_title, R.string.grand_tour, R.string.anheuser_busch_detailed_desc, R.string.mq_anheuser_busch ) ); attractions.add(new Attraction( R.drawable.coopersmith_brewing, R.string.coopersmith_title, R.string.coopersmith_mixed_desc, R.string.coopersmith_detailed_desc, R.string.mq_coopersmith ) ); return new AttractionCollection(R.string.top_breweries, attractions); } private AttractionRepository(Context context); static AttractionRepository getInstance(Context packageContext); AttractionCollection getCollection(int sectionTitle); List<AttractionCollection> getCollections(); }
|
AttractionRepository { @VisibleForTesting static AttractionCollection buildBreweriesCollection() { ArrayList<Attraction> attractions = new ArrayList<>(); attractions.add(new Attraction( R.drawable.new_belgium, R.string.new_belgium_title, R.string.new_belgium_free_tours, R.string.new_belgium_detailed_desc, R.string.mq_new_belgium ) ); attractions.add(new Attraction( R.drawable.odell_brewing, R.string.odell_brewing_title, R.string.odell_microbrew, R.string.odell_brewing_detailed_desc, R.string.mq_odell_brewing ) ); attractions.add(new Attraction( R.drawable.anheuser_busch, R.string.anheuser_busch_title, R.string.grand_tour, R.string.anheuser_busch_detailed_desc, R.string.mq_anheuser_busch ) ); attractions.add(new Attraction( R.drawable.coopersmith_brewing, R.string.coopersmith_title, R.string.coopersmith_mixed_desc, R.string.coopersmith_detailed_desc, R.string.mq_coopersmith ) ); return new AttractionCollection(R.string.top_breweries, attractions); } private AttractionRepository(Context context); static AttractionRepository getInstance(Context packageContext); AttractionCollection getCollection(int sectionTitle); List<AttractionCollection> getCollections(); }
|
@Test public void concrete_valid() { try { concreteValidator.validate(5); concreteValidator.validate(6); concreteValidator.validate(7); concreteValidator.validate(8); concreteValidator.validate(9); concreteValidator.validate(10); } catch (ValidationException e) { throw new AssertionError("This should be valid!"); } }
|
@Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); @SafeVarargs static CompositeValidator<T> of(Validator<? super T>... validators); static CompositeValidator<T> of(Iterable<Validator<? super T>> validators); static CompositeValidator<T> of(List<Validator<? super T>> validators); @Override void validate(T t); }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); @SafeVarargs static CompositeValidator<T> of(Validator<? super T>... validators); static CompositeValidator<T> of(Iterable<Validator<? super T>> validators); static CompositeValidator<T> of(List<Validator<? super T>> validators); @Override void validate(T t); }
|
@Test public void concrete_invalid() { try { concreteValidator.validate(4); throw new AssertionError("This should be invalid!"); } catch (ValidationException e) { assertThat(e).hasMessageThat() .isEqualTo("Was less than 5"); } try { concreteValidator.validate(11); throw new AssertionError("This should be invalid!"); } catch (ValidationException e) { assertThat(e).hasMessageThat() .isEqualTo("Was greater than 10"); } }
|
@Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); @SafeVarargs static CompositeValidator<T> of(Validator<? super T>... validators); static CompositeValidator<T> of(Iterable<Validator<? super T>> validators); static CompositeValidator<T> of(List<Validator<? super T>> validators); @Override void validate(T t); }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); @SafeVarargs static CompositeValidator<T> of(Validator<? super T>... validators); static CompositeValidator<T> of(Iterable<Validator<? super T>> validators); static CompositeValidator<T> of(List<Validator<? super T>> validators); @Override void validate(T t); }
|
@Test public void concrete_compositeValidation() { try { concreteValidator.validate(-1); throw new AssertionError("This should be invalid!"); } catch (ValidationException e) { assertThat(e).isInstanceOf(CompositeValidationException.class); CompositeValidationException ce = (CompositeValidationException) e; assertThat(ce.getExceptions()).hasSize(2); assertThat(e).hasMessageThat() .contains("Was less than 5"); assertThat(e).hasMessageThat() .contains("Was negative"); } }
|
@Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); @SafeVarargs static CompositeValidator<T> of(Validator<? super T>... validators); static CompositeValidator<T> of(Iterable<Validator<? super T>> validators); static CompositeValidator<T> of(List<Validator<? super T>> validators); @Override void validate(T t); }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); @SafeVarargs static CompositeValidator<T> of(Validator<? super T>... validators); static CompositeValidator<T> of(Iterable<Validator<? super T>> validators); static CompositeValidator<T> of(List<Validator<? super T>> validators); @Override void validate(T t); }
|
@Test public void reflective_valid() { try { reflectiveValidator.validate(new Foo(5)); reflectiveValidator.validate(new Foo(6)); reflectiveValidator.validate(new Foo(7)); reflectiveValidator.validate(new Foo(8)); reflectiveValidator.validate(new Foo(9)); reflectiveValidator.validate(new Foo(10)); } catch (ValidationException e) { throw new AssertionError("This should be valid!"); } }
|
@Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); @SafeVarargs static CompositeValidator<T> of(Validator<? super T>... validators); static CompositeValidator<T> of(Iterable<Validator<? super T>> validators); static CompositeValidator<T> of(List<Validator<? super T>> validators); @Override void validate(T t); }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); @SafeVarargs static CompositeValidator<T> of(Validator<? super T>... validators); static CompositeValidator<T> of(Iterable<Validator<? super T>> validators); static CompositeValidator<T> of(List<Validator<? super T>> validators); @Override void validate(T t); }
|
@Test public void reflective_invalid() { try { reflectiveValidator.validate(new Foo(4)); throw new AssertionError("This should be invalid!"); } catch (ValidationException e) { assertThat(e).hasMessageThat() .isEqualTo("Was less than 5"); } try { reflectiveValidator.validate(new Foo(11)); throw new AssertionError("This should be invalid!"); } catch (ValidationException e) { assertThat(e).hasMessageThat() .isEqualTo("Was greater than 10"); } }
|
@Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); @SafeVarargs static CompositeValidator<T> of(Validator<? super T>... validators); static CompositeValidator<T> of(Iterable<Validator<? super T>> validators); static CompositeValidator<T> of(List<Validator<? super T>> validators); @Override void validate(T t); }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); @SafeVarargs static CompositeValidator<T> of(Validator<? super T>... validators); static CompositeValidator<T> of(Iterable<Validator<? super T>> validators); static CompositeValidator<T> of(List<Validator<? super T>> validators); @Override void validate(T t); }
|
@Test public void reflective_compositeValidation() { try { reflectiveValidator.validate(new Foo(-1)); throw new AssertionError("This should be invalid!"); } catch (ValidationException e) { assertThat(e).isInstanceOf(CompositeValidationException.class); CompositeValidationException ce = (CompositeValidationException) e; assertThat(ce.getExceptions()).hasSize(2); assertThat(e).hasMessageThat() .contains("Was less than 5"); assertThat(e).hasMessageThat() .contains("Was negative"); } }
|
@Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); @SafeVarargs static CompositeValidator<T> of(Validator<? super T>... validators); static CompositeValidator<T> of(Iterable<Validator<? super T>> validators); static CompositeValidator<T> of(List<Validator<? super T>> validators); @Override void validate(T t); }
|
CompositeValidator extends Validator<T> { @Override public void validate(T t) throws CompositeValidationException { List<ValidationException> exceptions = new ArrayList<>(); for (Validator<? super T> validator : validators) { try { validator.validate(t); } catch (ValidationException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { if (exceptions.size() == 1) { throw exceptions.get(0); } else { throw new CompositeValidationException(exceptions); } } } private CompositeValidator(List<Validator<? super T>> validators); @SafeVarargs static CompositeValidator<T> of(Validator<? super T>... validators); static CompositeValidator<T> of(Iterable<Validator<? super T>> validators); static CompositeValidator<T> of(List<Validator<? super T>> validators); @Override void validate(T t); }
|
@Test public void test() { Inspector inspector = new Inspector.Builder() .build(); Data data = new Data(); try { inspector.validator(Data.class).validate(data); fail("No validation was run"); } catch (ValidationException e) { assertThat(e).hasMessageThat().contains("thing() was null"); } List<Data> dataList = Arrays.asList(new Data()); try { inspector.validator(Types.newParameterizedType(List.class, Data.class)).validate(dataList); fail("No validation was run"); } catch (ValidationException e) { assertThat(e).hasMessageThat().contains("thing() was null"); } }
|
public <T> Validator<T> validator(Type type) { return validator(type, Util.NO_ANNOTATIONS); }
|
Inspector { public <T> Validator<T> validator(Type type) { return validator(type, Util.NO_ANNOTATIONS); } }
|
Inspector { public <T> Validator<T> validator(Type type) { return validator(type, Util.NO_ANNOTATIONS); } Inspector(Builder builder); }
|
Inspector { public <T> Validator<T> validator(Type type) { return validator(type, Util.NO_ANNOTATIONS); } Inspector(Builder builder); Validator<T> validator(Type type); Validator<T> validator(Class<T> type); Validator<T> validator(Type type, Class<? extends Annotation> annotationType); @SuppressWarnings("unchecked") // Factories are required to return only matching Validators. Validator<T> validator(Type type, Set<? extends Annotation> annotations); @SuppressWarnings("unchecked") // Factories are required to return only matching Validators. Validator<T> nextValidator(Validator.Factory skipPast,
Type type,
Set<? extends Annotation> annotations); Inspector.Builder newBuilder(); }
|
Inspector { public <T> Validator<T> validator(Type type) { return validator(type, Util.NO_ANNOTATIONS); } Inspector(Builder builder); Validator<T> validator(Type type); Validator<T> validator(Class<T> type); Validator<T> validator(Type type, Class<? extends Annotation> annotationType); @SuppressWarnings("unchecked") // Factories are required to return only matching Validators. Validator<T> validator(Type type, Set<? extends Annotation> annotations); @SuppressWarnings("unchecked") // Factories are required to return only matching Validators. Validator<T> nextValidator(Validator.Factory skipPast,
Type type,
Set<? extends Annotation> annotations); Inspector.Builder newBuilder(); }
|
@Test public void testSelfValidating() { Inspector inspector = new Inspector.Builder() .build(); SelfValidatingType selfValidatingType = new SelfValidatingType(); try { inspector.validator(SelfValidatingType.class).validate(selfValidatingType); fail("This should throw a validation exception!"); } catch (ValidationException e) { assertThat(e).hasMessageThat().isEqualTo(VALIDATION_MESSAGE); } NestedInheritedSelfValidating nested = new NestedInheritedSelfValidating(); try { inspector.validator(NestedInheritedSelfValidating.class).validate(nested); fail("This should throw a validation exception!"); } catch (ValidationException e) { assertThat(e).hasMessageThat().isEqualTo(VALIDATION_MESSAGE); } }
|
public <T> Validator<T> validator(Type type) { return validator(type, Util.NO_ANNOTATIONS); }
|
Inspector { public <T> Validator<T> validator(Type type) { return validator(type, Util.NO_ANNOTATIONS); } }
|
Inspector { public <T> Validator<T> validator(Type type) { return validator(type, Util.NO_ANNOTATIONS); } Inspector(Builder builder); }
|
Inspector { public <T> Validator<T> validator(Type type) { return validator(type, Util.NO_ANNOTATIONS); } Inspector(Builder builder); Validator<T> validator(Type type); Validator<T> validator(Class<T> type); Validator<T> validator(Type type, Class<? extends Annotation> annotationType); @SuppressWarnings("unchecked") // Factories are required to return only matching Validators. Validator<T> validator(Type type, Set<? extends Annotation> annotations); @SuppressWarnings("unchecked") // Factories are required to return only matching Validators. Validator<T> nextValidator(Validator.Factory skipPast,
Type type,
Set<? extends Annotation> annotations); Inspector.Builder newBuilder(); }
|
Inspector { public <T> Validator<T> validator(Type type) { return validator(type, Util.NO_ANNOTATIONS); } Inspector(Builder builder); Validator<T> validator(Type type); Validator<T> validator(Class<T> type); Validator<T> validator(Type type, Class<? extends Annotation> annotationType); @SuppressWarnings("unchecked") // Factories are required to return only matching Validators. Validator<T> validator(Type type, Set<? extends Annotation> annotations); @SuppressWarnings("unchecked") // Factories are required to return only matching Validators. Validator<T> nextValidator(Validator.Factory skipPast,
Type type,
Set<? extends Annotation> annotations); Inspector.Builder newBuilder(); }
|
@Test public void testValidate() { OntModel output = null; OntModel correct = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel()); correct.read(SPARQLValidator.class.getClassLoader().getResourceAsStream("nif-correct-model.ttl"), "", "Turtle"); output = SPARQLValidator.getInstance().validate(correct); assertTrue(output.isEmpty()); OntModel erroneous = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel()); erroneous.read(SPARQLValidator.class.getClassLoader().getResourceAsStream("nif-erroneous-model.ttl"), "", "Turtle"); output = SPARQLValidator.getInstance().validate(erroneous); assertFalse(output.isEmpty()); }
|
public Model validate(OntModel toBeValidated, String query) { OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel()); NIFNamespaces.addRLOGPrefix(model); model.setNsPrefix("mylog", logPrefix); QueryExecution qe = QueryExecutionFactory.create(query, toBeValidated); ResultSet rs = qe.execSelect(); for (; rs.hasNext(); ) { QuerySolution qs = rs.next(); Resource relatedResource = qs.getResource("resource"); Resource logLevel = qs.getResource("logLevel"); Literal message = qs.getLiteral("message"); RLOGIndividuals rli; String uri = logLevel.getURI(); if (RLOGIndividuals.FATAL.getUri().equals(uri)) { rli = RLOGIndividuals.FATAL; } else if (RLOGIndividuals.ERROR.getUri().equals(uri)) { rli = RLOGIndividuals.ERROR; } else if (RLOGIndividuals.WARN.getUri().equals(uri)) { rli = RLOGIndividuals.WARN; } else if (RLOGIndividuals.INFO.getUri().equals(uri)) { rli = RLOGIndividuals.INFO; } else if (RLOGIndividuals.DEBUG.getUri().equals(uri)) { rli = RLOGIndividuals.DEBUG; } else if (RLOGIndividuals.TRACE.getUri().equals(uri)) { rli = RLOGIndividuals.TRACE; } else { rli = RLOGIndividuals.ALL; } String m = (message == null) ? "null at " + relatedResource : message.getString(); model.add(RLOGSLF4JBinding.log(logPrefix, m, rli, this.getClass().getCanonicalName(), relatedResource.getURI(), (quiet) ? null : log)); } return model; }
|
SPARQLValidator { public Model validate(OntModel toBeValidated, String query) { OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel()); NIFNamespaces.addRLOGPrefix(model); model.setNsPrefix("mylog", logPrefix); QueryExecution qe = QueryExecutionFactory.create(query, toBeValidated); ResultSet rs = qe.execSelect(); for (; rs.hasNext(); ) { QuerySolution qs = rs.next(); Resource relatedResource = qs.getResource("resource"); Resource logLevel = qs.getResource("logLevel"); Literal message = qs.getLiteral("message"); RLOGIndividuals rli; String uri = logLevel.getURI(); if (RLOGIndividuals.FATAL.getUri().equals(uri)) { rli = RLOGIndividuals.FATAL; } else if (RLOGIndividuals.ERROR.getUri().equals(uri)) { rli = RLOGIndividuals.ERROR; } else if (RLOGIndividuals.WARN.getUri().equals(uri)) { rli = RLOGIndividuals.WARN; } else if (RLOGIndividuals.INFO.getUri().equals(uri)) { rli = RLOGIndividuals.INFO; } else if (RLOGIndividuals.DEBUG.getUri().equals(uri)) { rli = RLOGIndividuals.DEBUG; } else if (RLOGIndividuals.TRACE.getUri().equals(uri)) { rli = RLOGIndividuals.TRACE; } else { rli = RLOGIndividuals.ALL; } String m = (message == null) ? "null at " + relatedResource : message.getString(); model.add(RLOGSLF4JBinding.log(logPrefix, m, rli, this.getClass().getCanonicalName(), relatedResource.getURI(), (quiet) ? null : log)); } return model; } }
|
SPARQLValidator { public Model validate(OntModel toBeValidated, String query) { OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel()); NIFNamespaces.addRLOGPrefix(model); model.setNsPrefix("mylog", logPrefix); QueryExecution qe = QueryExecutionFactory.create(query, toBeValidated); ResultSet rs = qe.execSelect(); for (; rs.hasNext(); ) { QuerySolution qs = rs.next(); Resource relatedResource = qs.getResource("resource"); Resource logLevel = qs.getResource("logLevel"); Literal message = qs.getLiteral("message"); RLOGIndividuals rli; String uri = logLevel.getURI(); if (RLOGIndividuals.FATAL.getUri().equals(uri)) { rli = RLOGIndividuals.FATAL; } else if (RLOGIndividuals.ERROR.getUri().equals(uri)) { rli = RLOGIndividuals.ERROR; } else if (RLOGIndividuals.WARN.getUri().equals(uri)) { rli = RLOGIndividuals.WARN; } else if (RLOGIndividuals.INFO.getUri().equals(uri)) { rli = RLOGIndividuals.INFO; } else if (RLOGIndividuals.DEBUG.getUri().equals(uri)) { rli = RLOGIndividuals.DEBUG; } else if (RLOGIndividuals.TRACE.getUri().equals(uri)) { rli = RLOGIndividuals.TRACE; } else { rli = RLOGIndividuals.ALL; } String m = (message == null) ? "null at " + relatedResource : message.getString(); model.add(RLOGSLF4JBinding.log(logPrefix, m, rli, this.getClass().getCanonicalName(), relatedResource.getURI(), (quiet) ? null : log)); } return model; } SPARQLValidator(OntModel testsuite, String logPrefix); }
|
SPARQLValidator { public Model validate(OntModel toBeValidated, String query) { OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel()); NIFNamespaces.addRLOGPrefix(model); model.setNsPrefix("mylog", logPrefix); QueryExecution qe = QueryExecutionFactory.create(query, toBeValidated); ResultSet rs = qe.execSelect(); for (; rs.hasNext(); ) { QuerySolution qs = rs.next(); Resource relatedResource = qs.getResource("resource"); Resource logLevel = qs.getResource("logLevel"); Literal message = qs.getLiteral("message"); RLOGIndividuals rli; String uri = logLevel.getURI(); if (RLOGIndividuals.FATAL.getUri().equals(uri)) { rli = RLOGIndividuals.FATAL; } else if (RLOGIndividuals.ERROR.getUri().equals(uri)) { rli = RLOGIndividuals.ERROR; } else if (RLOGIndividuals.WARN.getUri().equals(uri)) { rli = RLOGIndividuals.WARN; } else if (RLOGIndividuals.INFO.getUri().equals(uri)) { rli = RLOGIndividuals.INFO; } else if (RLOGIndividuals.DEBUG.getUri().equals(uri)) { rli = RLOGIndividuals.DEBUG; } else if (RLOGIndividuals.TRACE.getUri().equals(uri)) { rli = RLOGIndividuals.TRACE; } else { rli = RLOGIndividuals.ALL; } String m = (message == null) ? "null at " + relatedResource : message.getString(); model.add(RLOGSLF4JBinding.log(logPrefix, m, rli, this.getClass().getCanonicalName(), relatedResource.getURI(), (quiet) ? null : log)); } return model; } SPARQLValidator(OntModel testsuite, String logPrefix); static SPARQLValidator getInstance(); static SPARQLValidator getInstance(String suiteresource); static SPARQLValidator getInstance(File suiteresource); Model validate(OntModel toBeValidated, String query); OntModel validate(OntModel toBeValidated); static String getQuery(String file); static String convertStreamToString(InputStream is); String getLogPrefix(); boolean isQuiet(); void setQuiet(boolean quiet); OntModel getTestsuite(); String getVersion(); List<String> getTests(); String getSparqlPrefix(); }
|
SPARQLValidator { public Model validate(OntModel toBeValidated, String query) { OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel()); NIFNamespaces.addRLOGPrefix(model); model.setNsPrefix("mylog", logPrefix); QueryExecution qe = QueryExecutionFactory.create(query, toBeValidated); ResultSet rs = qe.execSelect(); for (; rs.hasNext(); ) { QuerySolution qs = rs.next(); Resource relatedResource = qs.getResource("resource"); Resource logLevel = qs.getResource("logLevel"); Literal message = qs.getLiteral("message"); RLOGIndividuals rli; String uri = logLevel.getURI(); if (RLOGIndividuals.FATAL.getUri().equals(uri)) { rli = RLOGIndividuals.FATAL; } else if (RLOGIndividuals.ERROR.getUri().equals(uri)) { rli = RLOGIndividuals.ERROR; } else if (RLOGIndividuals.WARN.getUri().equals(uri)) { rli = RLOGIndividuals.WARN; } else if (RLOGIndividuals.INFO.getUri().equals(uri)) { rli = RLOGIndividuals.INFO; } else if (RLOGIndividuals.DEBUG.getUri().equals(uri)) { rli = RLOGIndividuals.DEBUG; } else if (RLOGIndividuals.TRACE.getUri().equals(uri)) { rli = RLOGIndividuals.TRACE; } else { rli = RLOGIndividuals.ALL; } String m = (message == null) ? "null at " + relatedResource : message.getString(); model.add(RLOGSLF4JBinding.log(logPrefix, m, rli, this.getClass().getCanonicalName(), relatedResource.getURI(), (quiet) ? null : log)); } return model; } SPARQLValidator(OntModel testsuite, String logPrefix); static SPARQLValidator getInstance(); static SPARQLValidator getInstance(String suiteresource); static SPARQLValidator getInstance(File suiteresource); Model validate(OntModel toBeValidated, String query); OntModel validate(OntModel toBeValidated); static String getQuery(String file); static String convertStreamToString(InputStream is); String getLogPrefix(); boolean isQuiet(); void setQuiet(boolean quiet); OntModel getTestsuite(); String getVersion(); List<String> getTests(); String getSparqlPrefix(); }
|
@Test public void testDashboard() throws Exception { mockMvc.perform(get("/")) .andExpect(status().isOk()) .andExpect(view().name("dashboard")); }
|
@RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") public String dashboard() { return "dashboard"; }
|
ToDoController { @RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") public String dashboard() { return "dashboard"; } }
|
ToDoController { @RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") public String dashboard() { return "dashboard"; } }
|
ToDoController { @RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") public String dashboard() { return "dashboard"; } @RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") String dashboard(); @RequestMapping(value = "/todo/listdata", method = RequestMethod.GET, produces = "application/json") @ResponseBody Page<ToDo> listData(Pageable pageable, Authentication authentication); static Predicate constructPredicate(ToDoShareAccount toDoShareAccount); @RequestMapping(value = "/todo/list", method = RequestMethod.GET, produces = "text/html") String list(Model model, Authentication authentication); @RequestMapping(value = "/todo/{toDoId}", method = RequestMethod.GET, produces = "text/html") String edit(@PathVariable("toDoId") @ModelAttribute("toDoForm") ToDoForm toDoForm, Model model); @RequestMapping(value = "/todo/{toDoId}", method = RequestMethod.PUT, produces = "text/html") String update(@Valid ToDoForm toDoForm, BindingResult bindingResult, Authentication authentication, ModelMap model, RedirectAttributes redirectAttributes); @RequestMapping(value = "/todo/", method = RequestMethod.POST, produces = "text/html") String save(@Valid ToDoForm toDoForm, BindingResult bindingResult, Authentication authentication, ModelMap model, RedirectAttributes redirectAttributes); @RequestMapping(value = "/todo/{toDoId}", method = RequestMethod.DELETE, produces = "text/html") String delete(@PathVariable("toDoId") @ModelAttribute("toDoForm") ToDoForm toDoForm, RedirectAttributes redirectAttributes); }
|
ToDoController { @RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") public String dashboard() { return "dashboard"; } @RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") String dashboard(); @RequestMapping(value = "/todo/listdata", method = RequestMethod.GET, produces = "application/json") @ResponseBody Page<ToDo> listData(Pageable pageable, Authentication authentication); static Predicate constructPredicate(ToDoShareAccount toDoShareAccount); @RequestMapping(value = "/todo/list", method = RequestMethod.GET, produces = "text/html") String list(Model model, Authentication authentication); @RequestMapping(value = "/todo/{toDoId}", method = RequestMethod.GET, produces = "text/html") String edit(@PathVariable("toDoId") @ModelAttribute("toDoForm") ToDoForm toDoForm, Model model); @RequestMapping(value = "/todo/{toDoId}", method = RequestMethod.PUT, produces = "text/html") String update(@Valid ToDoForm toDoForm, BindingResult bindingResult, Authentication authentication, ModelMap model, RedirectAttributes redirectAttributes); @RequestMapping(value = "/todo/", method = RequestMethod.POST, produces = "text/html") String save(@Valid ToDoForm toDoForm, BindingResult bindingResult, Authentication authentication, ModelMap model, RedirectAttributes redirectAttributes); @RequestMapping(value = "/todo/{toDoId}", method = RequestMethod.DELETE, produces = "text/html") String delete(@PathVariable("toDoId") @ModelAttribute("toDoForm") ToDoForm toDoForm, RedirectAttributes redirectAttributes); }
|
@Test public void testShowProfile() throws Exception { mockMvc.perform(get("/profile")) .andExpect(status().isOk()); }
|
@RequestMapping(value = "/profile", method = RequestMethod.GET, produces = "text/html") public String showProfile() { return "profile"; }
|
ProfileController { @RequestMapping(value = "/profile", method = RequestMethod.GET, produces = "text/html") public String showProfile() { return "profile"; } }
|
ProfileController { @RequestMapping(value = "/profile", method = RequestMethod.GET, produces = "text/html") public String showProfile() { return "profile"; } }
|
ProfileController { @RequestMapping(value = "/profile", method = RequestMethod.GET, produces = "text/html") public String showProfile() { return "profile"; } @RequestMapping(value = "/profile", method = RequestMethod.GET, produces = "text/html") String showProfile(); }
|
ProfileController { @RequestMapping(value = "/profile", method = RequestMethod.GET, produces = "text/html") public String showProfile() { return "profile"; } @RequestMapping(value = "/profile", method = RequestMethod.GET, produces = "text/html") String showProfile(); }
|
@Test public void inject() { MockSpan span = mockTracer.buildSpan("test").start(); Headers headers = new RecordHeaders(); assertEquals(0, headers.toArray().length); TracingKafkaUtils.inject(span.context(), headers, mockTracer); assertTrue(headers.toArray().length > 0); }
|
public static void inject(SpanContext spanContext, Headers headers, Tracer tracer) { tracer.inject(spanContext, Format.Builtin.TEXT_MAP, new HeadersMapInjectAdapter(headers)); }
|
TracingKafkaUtils { public static void inject(SpanContext spanContext, Headers headers, Tracer tracer) { tracer.inject(spanContext, Format.Builtin.TEXT_MAP, new HeadersMapInjectAdapter(headers)); } }
|
TracingKafkaUtils { public static void inject(SpanContext spanContext, Headers headers, Tracer tracer) { tracer.inject(spanContext, Format.Builtin.TEXT_MAP, new HeadersMapInjectAdapter(headers)); } }
|
TracingKafkaUtils { public static void inject(SpanContext spanContext, Headers headers, Tracer tracer) { tracer.inject(spanContext, Format.Builtin.TEXT_MAP, new HeadersMapInjectAdapter(headers)); } static SpanContext extractSpanContext(Headers headers, Tracer tracer); static void inject(SpanContext spanContext, Headers headers,
Tracer tracer); static Span buildAndInjectSpan(ProducerRecord<K, V> record, Tracer tracer); static Span buildAndInjectSpan(ProducerRecord<K, V> record, Tracer tracer,
BiFunction<String, ProducerRecord, String> producerSpanNameProvider,
SpanContext parent); static Span buildAndInjectSpan(ProducerRecord<K, V> record, Tracer tracer,
BiFunction<String, ProducerRecord, String> producerSpanNameProvider,
SpanContext parent, Collection<SpanDecorator> spanDecorators); static void buildAndFinishChildSpan(ConsumerRecord<K, V> record, Tracer tracer); static void buildAndFinishChildSpan(ConsumerRecord<K, V> record, Tracer tracer,
BiFunction<String, ConsumerRecord, String> consumerSpanNameProvider); static void buildAndFinishChildSpan(ConsumerRecord<K, V> record, Tracer tracer,
BiFunction<String, ConsumerRecord, String> consumerSpanNameProvider,
Collection<SpanDecorator> spanDecorators); }
|
TracingKafkaUtils { public static void inject(SpanContext spanContext, Headers headers, Tracer tracer) { tracer.inject(spanContext, Format.Builtin.TEXT_MAP, new HeadersMapInjectAdapter(headers)); } static SpanContext extractSpanContext(Headers headers, Tracer tracer); static void inject(SpanContext spanContext, Headers headers,
Tracer tracer); static Span buildAndInjectSpan(ProducerRecord<K, V> record, Tracer tracer); static Span buildAndInjectSpan(ProducerRecord<K, V> record, Tracer tracer,
BiFunction<String, ProducerRecord, String> producerSpanNameProvider,
SpanContext parent); static Span buildAndInjectSpan(ProducerRecord<K, V> record, Tracer tracer,
BiFunction<String, ProducerRecord, String> producerSpanNameProvider,
SpanContext parent, Collection<SpanDecorator> spanDecorators); static void buildAndFinishChildSpan(ConsumerRecord<K, V> record, Tracer tracer); static void buildAndFinishChildSpan(ConsumerRecord<K, V> record, Tracer tracer,
BiFunction<String, ConsumerRecord, String> consumerSpanNameProvider); static void buildAndFinishChildSpan(ConsumerRecord<K, V> record, Tracer tracer,
BiFunction<String, ConsumerRecord, String> consumerSpanNameProvider,
Collection<SpanDecorator> spanDecorators); static final String TO_PREFIX; static final String FROM_PREFIX; }
|
@Test public void extract_no_context() { Headers headers = new RecordHeaders(); MockSpan.MockContext spanContext = (MockSpan.MockContext) TracingKafkaUtils .extractSpanContext(headers, mockTracer); assertNull(spanContext); }
|
public static SpanContext extractSpanContext(Headers headers, Tracer tracer) { return tracer .extract(Format.Builtin.TEXT_MAP, new HeadersMapExtractAdapter(headers)); }
|
TracingKafkaUtils { public static SpanContext extractSpanContext(Headers headers, Tracer tracer) { return tracer .extract(Format.Builtin.TEXT_MAP, new HeadersMapExtractAdapter(headers)); } }
|
TracingKafkaUtils { public static SpanContext extractSpanContext(Headers headers, Tracer tracer) { return tracer .extract(Format.Builtin.TEXT_MAP, new HeadersMapExtractAdapter(headers)); } }
|
TracingKafkaUtils { public static SpanContext extractSpanContext(Headers headers, Tracer tracer) { return tracer .extract(Format.Builtin.TEXT_MAP, new HeadersMapExtractAdapter(headers)); } static SpanContext extractSpanContext(Headers headers, Tracer tracer); static void inject(SpanContext spanContext, Headers headers,
Tracer tracer); static Span buildAndInjectSpan(ProducerRecord<K, V> record, Tracer tracer); static Span buildAndInjectSpan(ProducerRecord<K, V> record, Tracer tracer,
BiFunction<String, ProducerRecord, String> producerSpanNameProvider,
SpanContext parent); static Span buildAndInjectSpan(ProducerRecord<K, V> record, Tracer tracer,
BiFunction<String, ProducerRecord, String> producerSpanNameProvider,
SpanContext parent, Collection<SpanDecorator> spanDecorators); static void buildAndFinishChildSpan(ConsumerRecord<K, V> record, Tracer tracer); static void buildAndFinishChildSpan(ConsumerRecord<K, V> record, Tracer tracer,
BiFunction<String, ConsumerRecord, String> consumerSpanNameProvider); static void buildAndFinishChildSpan(ConsumerRecord<K, V> record, Tracer tracer,
BiFunction<String, ConsumerRecord, String> consumerSpanNameProvider,
Collection<SpanDecorator> spanDecorators); }
|
TracingKafkaUtils { public static SpanContext extractSpanContext(Headers headers, Tracer tracer) { return tracer .extract(Format.Builtin.TEXT_MAP, new HeadersMapExtractAdapter(headers)); } static SpanContext extractSpanContext(Headers headers, Tracer tracer); static void inject(SpanContext spanContext, Headers headers,
Tracer tracer); static Span buildAndInjectSpan(ProducerRecord<K, V> record, Tracer tracer); static Span buildAndInjectSpan(ProducerRecord<K, V> record, Tracer tracer,
BiFunction<String, ProducerRecord, String> producerSpanNameProvider,
SpanContext parent); static Span buildAndInjectSpan(ProducerRecord<K, V> record, Tracer tracer,
BiFunction<String, ProducerRecord, String> producerSpanNameProvider,
SpanContext parent, Collection<SpanDecorator> spanDecorators); static void buildAndFinishChildSpan(ConsumerRecord<K, V> record, Tracer tracer); static void buildAndFinishChildSpan(ConsumerRecord<K, V> record, Tracer tracer,
BiFunction<String, ConsumerRecord, String> consumerSpanNameProvider); static void buildAndFinishChildSpan(ConsumerRecord<K, V> record, Tracer tracer,
BiFunction<String, ConsumerRecord, String> consumerSpanNameProvider,
Collection<SpanDecorator> spanDecorators); static final String TO_PREFIX; static final String FROM_PREFIX; }
|
@Test public void verifyNullHeaderHandled() { Headers headers = new RecordHeaders(); headers.add("test_null_header", null); HeadersMapExtractAdapter headersMapExtractAdapter = new HeadersMapExtractAdapter(headers); Entry<String, String> header = headersMapExtractAdapter.iterator().next(); assertNotNull(header); assertEquals(header.getKey(), "test_null_header"); assertNull(header.getValue()); }
|
@Override public Iterator<Entry<String, String>> iterator() { return map.entrySet().iterator(); }
|
HeadersMapExtractAdapter implements TextMap { @Override public Iterator<Entry<String, String>> iterator() { return map.entrySet().iterator(); } }
|
HeadersMapExtractAdapter implements TextMap { @Override public Iterator<Entry<String, String>> iterator() { return map.entrySet().iterator(); } HeadersMapExtractAdapter(Headers headers); }
|
HeadersMapExtractAdapter implements TextMap { @Override public Iterator<Entry<String, String>> iterator() { return map.entrySet().iterator(); } HeadersMapExtractAdapter(Headers headers); @Override Iterator<Entry<String, String>> iterator(); @Override void put(String key, String value); }
|
HeadersMapExtractAdapter implements TextMap { @Override public Iterator<Entry<String, String>> iterator() { return map.entrySet().iterator(); } HeadersMapExtractAdapter(Headers headers); @Override Iterator<Entry<String, String>> iterator(); @Override void put(String key, String value); }
|
@Test public void onCompletionWithError() { Span span = mockTracer.buildSpan("test").start(); try (Scope ignored = mockTracer.activateSpan(span)) { TracingCallback callback = new TracingCallback(null, span, mockTracer); callback.onCompletion(null, new RuntimeException("test")); } List<MockSpan> finished = mockTracer.finishedSpans(); assertEquals(1, finished.size()); assertEquals(1, finished.get(0).logEntries().size()); assertEquals(true, finished.get(0).tags().get(Tags.ERROR.getKey())); }
|
@Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } }
|
TracingCallback implements Callback { @Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } } }
|
TracingCallback implements Callback { @Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } } TracingCallback(Callback callback, Span span, Tracer tracer); TracingCallback(Callback callback, Span span, Tracer tracer,
Collection<SpanDecorator> spanDecorators); }
|
TracingCallback implements Callback { @Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } } TracingCallback(Callback callback, Span span, Tracer tracer); TracingCallback(Callback callback, Span span, Tracer tracer,
Collection<SpanDecorator> spanDecorators); @Override void onCompletion(RecordMetadata metadata, Exception exception); }
|
TracingCallback implements Callback { @Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } } TracingCallback(Callback callback, Span span, Tracer tracer); TracingCallback(Callback callback, Span span, Tracer tracer,
Collection<SpanDecorator> spanDecorators); @Override void onCompletion(RecordMetadata metadata, Exception exception); }
|
@Test public void onCompletionWithCustomErrorDecorators() { Span span = mockTracer.buildSpan("test").start(); try (Scope ignored = mockTracer.activateSpan(span)) { TracingCallback callback = new TracingCallback(null, span, mockTracer, Arrays.asList(SpanDecorator.STANDARD_TAGS, createDecorator())); callback.onCompletion(null, new RuntimeException("test")); } List<MockSpan> finished = mockTracer.finishedSpans(); assertEquals(1, finished.size()); assertEquals(true, finished.get(0).tags().get(Tags.ERROR.getKey())); assertEquals("overwritten", finished.get(0).tags().get("error.of")); assertEquals("error-test", finished.get(0).tags().get("new.error.tag")); }
|
@Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } }
|
TracingCallback implements Callback { @Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } } }
|
TracingCallback implements Callback { @Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } } TracingCallback(Callback callback, Span span, Tracer tracer); TracingCallback(Callback callback, Span span, Tracer tracer,
Collection<SpanDecorator> spanDecorators); }
|
TracingCallback implements Callback { @Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } } TracingCallback(Callback callback, Span span, Tracer tracer); TracingCallback(Callback callback, Span span, Tracer tracer,
Collection<SpanDecorator> spanDecorators); @Override void onCompletion(RecordMetadata metadata, Exception exception); }
|
TracingCallback implements Callback { @Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } } TracingCallback(Callback callback, Span span, Tracer tracer); TracingCallback(Callback callback, Span span, Tracer tracer,
Collection<SpanDecorator> spanDecorators); @Override void onCompletion(RecordMetadata metadata, Exception exception); }
|
@Test public void onCompletion() { Span span = mockTracer.buildSpan("test").start(); try (Scope ignored = mockTracer.activateSpan(span)) { TracingCallback callback = new TracingCallback(null, span, mockTracer); callback.onCompletion(null, null); } List<MockSpan> finished = mockTracer.finishedSpans(); assertEquals(1, finished.size()); assertEquals(0, finished.get(0).logEntries().size()); assertNull(finished.get(0).tags().get(Tags.ERROR.getKey())); }
|
@Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } }
|
TracingCallback implements Callback { @Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } } }
|
TracingCallback implements Callback { @Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } } TracingCallback(Callback callback, Span span, Tracer tracer); TracingCallback(Callback callback, Span span, Tracer tracer,
Collection<SpanDecorator> spanDecorators); }
|
TracingCallback implements Callback { @Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } } TracingCallback(Callback callback, Span span, Tracer tracer); TracingCallback(Callback callback, Span span, Tracer tracer,
Collection<SpanDecorator> spanDecorators); @Override void onCompletion(RecordMetadata metadata, Exception exception); }
|
TracingCallback implements Callback { @Override public void onCompletion(RecordMetadata metadata, Exception exception) { if (exception != null) { for (SpanDecorator decorator : spanDecorators) { decorator.onError(exception, span); } } try (Scope ignored = tracer.scopeManager().activate(span)) { if (callback != null) { callback.onCompletion(metadata, exception); } } finally { span.finish(); } } TracingCallback(Callback callback, Span span, Tracer tracer); TracingCallback(Callback callback, Span span, Tracer tracer,
Collection<SpanDecorator> spanDecorators); @Override void onCompletion(RecordMetadata metadata, Exception exception); }
|
@Test public void onStart_isSuccess() { Context context = RuntimeEnvironment.application.getApplicationContext(); RateThisApp.onStart(context); SharedPreferences sharedPreferences = RuntimeEnvironment.application.getSharedPreferences( PREF_NAME, Context.MODE_PRIVATE); long expectedInstallDate = 0L; PackageManager packMan = context.getPackageManager(); try { PackageInfo pkgInfo = packMan.getPackageInfo(context.getPackageName(), 0); expectedInstallDate = new Date(pkgInfo.firstInstallTime).getTime(); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } Assert.assertEquals(expectedInstallDate, sharedPreferences.getLong(KEY_INSTALL_DATE, 0L)); Assert.assertEquals(1, sharedPreferences.getInt(KEY_LAUNCH_TIMES, 0)); }
|
@Deprecated public static void onStart(Context context) { onCreate(context); }
|
RateThisApp { @Deprecated public static void onStart(Context context) { onCreate(context); } }
|
RateThisApp { @Deprecated public static void onStart(Context context) { onCreate(context); } }
|
RateThisApp { @Deprecated public static void onStart(Context context) { onCreate(context); } static void init(Config config); static void setCallback(Callback callback); static void onCreate(Context context); @Deprecated static void onStart(Context context); static boolean showRateDialogIfNeeded(final Context context); static boolean showRateDialogIfNeeded(final Context context, int themeId); static boolean shouldShowRateDialog(); static void showRateDialog(final Context context); static void showRateDialog(final Context context, int themeId); static void stopRateDialog(final Context context); static int getLaunchCount(final Context context); }
|
RateThisApp { @Deprecated public static void onStart(Context context) { onCreate(context); } static void init(Config config); static void setCallback(Callback callback); static void onCreate(Context context); @Deprecated static void onStart(Context context); static boolean showRateDialogIfNeeded(final Context context); static boolean showRateDialogIfNeeded(final Context context, int themeId); static boolean shouldShowRateDialog(); static void showRateDialog(final Context context); static void showRateDialog(final Context context, int themeId); static void stopRateDialog(final Context context); static int getLaunchCount(final Context context); static final boolean DEBUG; }
|
@Test public void stopRateDialog_IsSuccess() { Context context = RuntimeEnvironment.application.getApplicationContext(); RateThisApp.stopRateDialog(context); SharedPreferences sharedPreferences = RuntimeEnvironment.application.getSharedPreferences( PREF_NAME, Context.MODE_PRIVATE); Assert.assertTrue(sharedPreferences.getBoolean(KEY_OPT_OUT, false)); }
|
public static void stopRateDialog(final Context context){ setOptOut(context, true); }
|
RateThisApp { public static void stopRateDialog(final Context context){ setOptOut(context, true); } }
|
RateThisApp { public static void stopRateDialog(final Context context){ setOptOut(context, true); } }
|
RateThisApp { public static void stopRateDialog(final Context context){ setOptOut(context, true); } static void init(Config config); static void setCallback(Callback callback); static void onCreate(Context context); @Deprecated static void onStart(Context context); static boolean showRateDialogIfNeeded(final Context context); static boolean showRateDialogIfNeeded(final Context context, int themeId); static boolean shouldShowRateDialog(); static void showRateDialog(final Context context); static void showRateDialog(final Context context, int themeId); static void stopRateDialog(final Context context); static int getLaunchCount(final Context context); }
|
RateThisApp { public static void stopRateDialog(final Context context){ setOptOut(context, true); } static void init(Config config); static void setCallback(Callback callback); static void onCreate(Context context); @Deprecated static void onStart(Context context); static boolean showRateDialogIfNeeded(final Context context); static boolean showRateDialogIfNeeded(final Context context, int themeId); static boolean shouldShowRateDialog(); static void showRateDialog(final Context context); static void showRateDialog(final Context context, int themeId); static void stopRateDialog(final Context context); static int getLaunchCount(final Context context); static final boolean DEBUG; }
|
@Test public void testConstructor() { Date epoch = new Date(0); Calendar currentCalendar = Calendar.getInstance(); Date current = currentCalendar.getTime(); currentCalendar.add(Calendar.HOUR, -1); Date past = currentCalendar.getTime(); currentCalendar.add(Calendar.HOUR, 2); Date future = currentCalendar.getTime(); DateTrigger dateTrigger = new DateTrigger(current, epoch, future, past); Date nextExecutionTime = dateTrigger.nextExecutionTime(null); assertNotNull("Should return epoch", nextExecutionTime); assertTrue("Should be epoch", epoch.compareTo(nextExecutionTime) == 0); nextExecutionTime = dateTrigger.nextExecutionTime(null); assertNotNull("Should return past", nextExecutionTime); assertTrue("Should be past", past.compareTo(nextExecutionTime) == 0); nextExecutionTime = dateTrigger.nextExecutionTime(null); assertNotNull("Should return current", nextExecutionTime); assertTrue("Should be current", current.compareTo(nextExecutionTime) == 0); nextExecutionTime = dateTrigger.nextExecutionTime(null); assertNotNull("Should return future", nextExecutionTime); assertTrue("Should be future", future.compareTo(nextExecutionTime) == 0); nextExecutionTime = dateTrigger.nextExecutionTime(null); assertNull("All entries should have been pulled, the nextExecutionTime should have been null.", nextExecutionTime); }
|
@Override public Date nextExecutionTime(TriggerContext triggerContext) { Date result = null; if (nextFireDates.size() > 0) { try { result = nextFireDates.remove(0); } catch (IndexOutOfBoundsException e) { logger.debug(e.getMessage()); } } return result; }
|
DateTrigger implements Trigger { @Override public Date nextExecutionTime(TriggerContext triggerContext) { Date result = null; if (nextFireDates.size() > 0) { try { result = nextFireDates.remove(0); } catch (IndexOutOfBoundsException e) { logger.debug(e.getMessage()); } } return result; } }
|
DateTrigger implements Trigger { @Override public Date nextExecutionTime(TriggerContext triggerContext) { Date result = null; if (nextFireDates.size() > 0) { try { result = nextFireDates.remove(0); } catch (IndexOutOfBoundsException e) { logger.debug(e.getMessage()); } } return result; } DateTrigger(Date... dates); }
|
DateTrigger implements Trigger { @Override public Date nextExecutionTime(TriggerContext triggerContext) { Date result = null; if (nextFireDates.size() > 0) { try { result = nextFireDates.remove(0); } catch (IndexOutOfBoundsException e) { logger.debug(e.getMessage()); } } return result; } DateTrigger(Date... dates); @Override Date nextExecutionTime(TriggerContext triggerContext); }
|
DateTrigger implements Trigger { @Override public Date nextExecutionTime(TriggerContext triggerContext) { Date result = null; if (nextFireDates.size() > 0) { try { result = nextFireDates.remove(0); } catch (IndexOutOfBoundsException e) { logger.debug(e.getMessage()); } } return result; } DateTrigger(Date... dates); @Override Date nextExecutionTime(TriggerContext triggerContext); }
|
@Test public void testRenderParameterInfoDataAsTableWithMaxWidth() { final Map<String, String> values = new TreeMap<String, String>(); values.put("Key1", "Lorem ipsum dolor sit posuere."); values.put("My super key 2", "Lorem ipsum"); String expectedTableAsString = null; final InputStream inputStream = getClass() .getClassLoader() .getResourceAsStream("testRenderParameterInfoDataAsTableWithMaxWidth.txt"); assertNotNull("The inputstream is null.", inputStream); try { expectedTableAsString = FileCopyUtils.copyToString(new InputStreamReader(inputStream)); } catch (IOException e) { e.printStackTrace(); fail(); } final String tableRenderedAsString = UiUtils.renderParameterInfoDataAsTable(values, false, 20); assertEquals(expectedTableAsString.replaceAll("\r", ""), tableRenderedAsString); }
|
public static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader, int lastColumnMaxWidth) { final Table table = new Table(); table.getHeaders().put(COLUMN_1, new TableHeader("Parameter")); final TableHeader tableHeader2 = new TableHeader("Value (Configured or Default)"); tableHeader2.setMaxWidth(lastColumnMaxWidth); table.getHeaders().put(COLUMN_2, tableHeader2); for (Entry<String, String> entry : parameters.entrySet()) { final TableRow tableRow = new TableRow(); table.getHeaders().get(COLUMN_1).updateWidth(entry.getKey().length()); tableRow.addValue(COLUMN_1, entry.getKey()); int width = entry.getValue() != null ? entry.getValue().length() : 0; table.getHeaders().get(COLUMN_2).updateWidth(width); tableRow.addValue(COLUMN_2, entry.getValue()); table.getRows().add(tableRow); } return renderTextTable(table, withHeader); }
|
UiUtils { public static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader, int lastColumnMaxWidth) { final Table table = new Table(); table.getHeaders().put(COLUMN_1, new TableHeader("Parameter")); final TableHeader tableHeader2 = new TableHeader("Value (Configured or Default)"); tableHeader2.setMaxWidth(lastColumnMaxWidth); table.getHeaders().put(COLUMN_2, tableHeader2); for (Entry<String, String> entry : parameters.entrySet()) { final TableRow tableRow = new TableRow(); table.getHeaders().get(COLUMN_1).updateWidth(entry.getKey().length()); tableRow.addValue(COLUMN_1, entry.getKey()); int width = entry.getValue() != null ? entry.getValue().length() : 0; table.getHeaders().get(COLUMN_2).updateWidth(width); tableRow.addValue(COLUMN_2, entry.getValue()); table.getRows().add(tableRow); } return renderTextTable(table, withHeader); } }
|
UiUtils { public static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader, int lastColumnMaxWidth) { final Table table = new Table(); table.getHeaders().put(COLUMN_1, new TableHeader("Parameter")); final TableHeader tableHeader2 = new TableHeader("Value (Configured or Default)"); tableHeader2.setMaxWidth(lastColumnMaxWidth); table.getHeaders().put(COLUMN_2, tableHeader2); for (Entry<String, String> entry : parameters.entrySet()) { final TableRow tableRow = new TableRow(); table.getHeaders().get(COLUMN_1).updateWidth(entry.getKey().length()); tableRow.addValue(COLUMN_1, entry.getKey()); int width = entry.getValue() != null ? entry.getValue().length() : 0; table.getHeaders().get(COLUMN_2).updateWidth(width); tableRow.addValue(COLUMN_2, entry.getValue()); table.getRows().add(tableRow); } return renderTextTable(table, withHeader); } private UiUtils(); }
|
UiUtils { public static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader, int lastColumnMaxWidth) { final Table table = new Table(); table.getHeaders().put(COLUMN_1, new TableHeader("Parameter")); final TableHeader tableHeader2 = new TableHeader("Value (Configured or Default)"); tableHeader2.setMaxWidth(lastColumnMaxWidth); table.getHeaders().put(COLUMN_2, tableHeader2); for (Entry<String, String> entry : parameters.entrySet()) { final TableRow tableRow = new TableRow(); table.getHeaders().get(COLUMN_1).updateWidth(entry.getKey().length()); tableRow.addValue(COLUMN_1, entry.getKey()); int width = entry.getValue() != null ? entry.getValue().length() : 0; table.getHeaders().get(COLUMN_2).updateWidth(width); tableRow.addValue(COLUMN_2, entry.getValue()); table.getRows().add(tableRow); } return renderTextTable(table, withHeader); } private UiUtils(); static String renderMapDataAsTable(List<Map<String, Object>> data, List<String> columns); static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader,
int lastColumnMaxWidth); static String renderParameterInfoDataAsTable(Map<String, String> parameters); static String renderTextTable(Table table); static String renderTextTable(Table table, boolean withHeader); static String getHeaderBorder(Map<Integer, TableHeader> headers); }
|
UiUtils { public static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader, int lastColumnMaxWidth) { final Table table = new Table(); table.getHeaders().put(COLUMN_1, new TableHeader("Parameter")); final TableHeader tableHeader2 = new TableHeader("Value (Configured or Default)"); tableHeader2.setMaxWidth(lastColumnMaxWidth); table.getHeaders().put(COLUMN_2, tableHeader2); for (Entry<String, String> entry : parameters.entrySet()) { final TableRow tableRow = new TableRow(); table.getHeaders().get(COLUMN_1).updateWidth(entry.getKey().length()); tableRow.addValue(COLUMN_1, entry.getKey()); int width = entry.getValue() != null ? entry.getValue().length() : 0; table.getHeaders().get(COLUMN_2).updateWidth(width); tableRow.addValue(COLUMN_2, entry.getValue()); table.getRows().add(tableRow); } return renderTextTable(table, withHeader); } private UiUtils(); static String renderMapDataAsTable(List<Map<String, Object>> data, List<String> columns); static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader,
int lastColumnMaxWidth); static String renderParameterInfoDataAsTable(Map<String, String> parameters); static String renderTextTable(Table table); static String renderTextTable(Table table, boolean withHeader); static String getHeaderBorder(Map<Integer, TableHeader> headers); static final String HORIZONTAL_LINE; static final int COLUMN_1; static final int COLUMN_2; static final int COLUMN_3; static final int COLUMN_4; static final int COLUMN_5; static final int COLUMN_6; }
|
@Test(expected = IllegalArgumentException.class) public void throwsExceptionWhenDoubleQuotedStringsAreMisQuoted() { this.parser.parse("a \"b c d e"); }
|
List<String> parse(String s) { List<String> words = new ArrayList<>(); String field = ""; Matcher matcher = SHELLWORDS.matcher(s); while (matcher.find()) { String word = matcher.group(1); String sq = matcher.group(2); String dq = matcher.group(3); String esc = matcher.group(4); String garbage = matcher.group(5); String sep = matcher.group(6); if (garbage != null) { throw new IllegalArgumentException("Unmatched double quote: " + s); } if (word != null) { field = word; } else if (sq != null) { field = sq; } else if (dq != null) { field = dq.replaceAll("\\\\(?=.)", ""); } else if (esc != null) { field = esc.replaceAll("\\\\(?=.)", ""); } if (sep != null) { words.add(field); field = ""; } } return words; }
|
ShellWordsParser { List<String> parse(String s) { List<String> words = new ArrayList<>(); String field = ""; Matcher matcher = SHELLWORDS.matcher(s); while (matcher.find()) { String word = matcher.group(1); String sq = matcher.group(2); String dq = matcher.group(3); String esc = matcher.group(4); String garbage = matcher.group(5); String sep = matcher.group(6); if (garbage != null) { throw new IllegalArgumentException("Unmatched double quote: " + s); } if (word != null) { field = word; } else if (sq != null) { field = sq; } else if (dq != null) { field = dq.replaceAll("\\\\(?=.)", ""); } else if (esc != null) { field = esc.replaceAll("\\\\(?=.)", ""); } if (sep != null) { words.add(field); field = ""; } } return words; } }
|
ShellWordsParser { List<String> parse(String s) { List<String> words = new ArrayList<>(); String field = ""; Matcher matcher = SHELLWORDS.matcher(s); while (matcher.find()) { String word = matcher.group(1); String sq = matcher.group(2); String dq = matcher.group(3); String esc = matcher.group(4); String garbage = matcher.group(5); String sep = matcher.group(6); if (garbage != null) { throw new IllegalArgumentException("Unmatched double quote: " + s); } if (word != null) { field = word; } else if (sq != null) { field = sq; } else if (dq != null) { field = dq.replaceAll("\\\\(?=.)", ""); } else if (esc != null) { field = esc.replaceAll("\\\\(?=.)", ""); } if (sep != null) { words.add(field); field = ""; } } return words; } }
|
ShellWordsParser { List<String> parse(String s) { List<String> words = new ArrayList<>(); String field = ""; Matcher matcher = SHELLWORDS.matcher(s); while (matcher.find()) { String word = matcher.group(1); String sq = matcher.group(2); String dq = matcher.group(3); String esc = matcher.group(4); String garbage = matcher.group(5); String sep = matcher.group(6); if (garbage != null) { throw new IllegalArgumentException("Unmatched double quote: " + s); } if (word != null) { field = word; } else if (sq != null) { field = sq; } else if (dq != null) { field = dq.replaceAll("\\\\(?=.)", ""); } else if (esc != null) { field = esc.replaceAll("\\\\(?=.)", ""); } if (sep != null) { words.add(field); field = ""; } } return words; } }
|
ShellWordsParser { List<String> parse(String s) { List<String> words = new ArrayList<>(); String field = ""; Matcher matcher = SHELLWORDS.matcher(s); while (matcher.find()) { String word = matcher.group(1); String sq = matcher.group(2); String dq = matcher.group(3); String esc = matcher.group(4); String garbage = matcher.group(5); String sep = matcher.group(6); if (garbage != null) { throw new IllegalArgumentException("Unmatched double quote: " + s); } if (word != null) { field = word; } else if (sq != null) { field = sq; } else if (dq != null) { field = dq.replaceAll("\\\\(?=.)", ""); } else if (esc != null) { field = esc.replaceAll("\\\\(?=.)", ""); } if (sep != null) { words.add(field); field = ""; } } return words; } }
|
@Test(expected = IllegalArgumentException.class) public void throwsExceptionWhenSingleQuotedStringsAreMisQuoted() { this.parser.parse("a 'b c d e"); }
|
List<String> parse(String s) { List<String> words = new ArrayList<>(); String field = ""; Matcher matcher = SHELLWORDS.matcher(s); while (matcher.find()) { String word = matcher.group(1); String sq = matcher.group(2); String dq = matcher.group(3); String esc = matcher.group(4); String garbage = matcher.group(5); String sep = matcher.group(6); if (garbage != null) { throw new IllegalArgumentException("Unmatched double quote: " + s); } if (word != null) { field = word; } else if (sq != null) { field = sq; } else if (dq != null) { field = dq.replaceAll("\\\\(?=.)", ""); } else if (esc != null) { field = esc.replaceAll("\\\\(?=.)", ""); } if (sep != null) { words.add(field); field = ""; } } return words; }
|
ShellWordsParser { List<String> parse(String s) { List<String> words = new ArrayList<>(); String field = ""; Matcher matcher = SHELLWORDS.matcher(s); while (matcher.find()) { String word = matcher.group(1); String sq = matcher.group(2); String dq = matcher.group(3); String esc = matcher.group(4); String garbage = matcher.group(5); String sep = matcher.group(6); if (garbage != null) { throw new IllegalArgumentException("Unmatched double quote: " + s); } if (word != null) { field = word; } else if (sq != null) { field = sq; } else if (dq != null) { field = dq.replaceAll("\\\\(?=.)", ""); } else if (esc != null) { field = esc.replaceAll("\\\\(?=.)", ""); } if (sep != null) { words.add(field); field = ""; } } return words; } }
|
ShellWordsParser { List<String> parse(String s) { List<String> words = new ArrayList<>(); String field = ""; Matcher matcher = SHELLWORDS.matcher(s); while (matcher.find()) { String word = matcher.group(1); String sq = matcher.group(2); String dq = matcher.group(3); String esc = matcher.group(4); String garbage = matcher.group(5); String sep = matcher.group(6); if (garbage != null) { throw new IllegalArgumentException("Unmatched double quote: " + s); } if (word != null) { field = word; } else if (sq != null) { field = sq; } else if (dq != null) { field = dq.replaceAll("\\\\(?=.)", ""); } else if (esc != null) { field = esc.replaceAll("\\\\(?=.)", ""); } if (sep != null) { words.add(field); field = ""; } } return words; } }
|
ShellWordsParser { List<String> parse(String s) { List<String> words = new ArrayList<>(); String field = ""; Matcher matcher = SHELLWORDS.matcher(s); while (matcher.find()) { String word = matcher.group(1); String sq = matcher.group(2); String dq = matcher.group(3); String esc = matcher.group(4); String garbage = matcher.group(5); String sep = matcher.group(6); if (garbage != null) { throw new IllegalArgumentException("Unmatched double quote: " + s); } if (word != null) { field = word; } else if (sq != null) { field = sq; } else if (dq != null) { field = dq.replaceAll("\\\\(?=.)", ""); } else if (esc != null) { field = esc.replaceAll("\\\\(?=.)", ""); } if (sep != null) { words.add(field); field = ""; } } return words; } }
|
ShellWordsParser { List<String> parse(String s) { List<String> words = new ArrayList<>(); String field = ""; Matcher matcher = SHELLWORDS.matcher(s); while (matcher.find()) { String word = matcher.group(1); String sq = matcher.group(2); String dq = matcher.group(3); String esc = matcher.group(4); String garbage = matcher.group(5); String sep = matcher.group(6); if (garbage != null) { throw new IllegalArgumentException("Unmatched double quote: " + s); } if (word != null) { field = word; } else if (sq != null) { field = sq; } else if (dq != null) { field = dq.replaceAll("\\\\(?=.)", ""); } else if (esc != null) { field = esc.replaceAll("\\\\(?=.)", ""); } if (sep != null) { words.add(field); field = ""; } } return words; } }
|
@Test public void testEvaluateDummyMappedAnalytic() { Tuple input = TupleBuilder.tuple().of("k1", "v1", "k2", "v2"); Tuple output = analytic.evaluate(input); assertNotSame(input, output); assertThat(output.getString("k1"), is("V1")); assertThat(output.getString("k2"), is("V2")); }
|
@Override @SuppressWarnings("unchecked") public O evaluate(I input) { Assert.notNull(input, "input"); MI modelInput = inputMapper.mapInput((A) this, input); MO modelOutput = evaluateInternal(modelInput); O output = outputMapper.mapOutput((A) this, input, modelOutput); return output; }
|
MappedAnalytic implements Analytic<I, O> { @Override @SuppressWarnings("unchecked") public O evaluate(I input) { Assert.notNull(input, "input"); MI modelInput = inputMapper.mapInput((A) this, input); MO modelOutput = evaluateInternal(modelInput); O output = outputMapper.mapOutput((A) this, input, modelOutput); return output; } }
|
MappedAnalytic implements Analytic<I, O> { @Override @SuppressWarnings("unchecked") public O evaluate(I input) { Assert.notNull(input, "input"); MI modelInput = inputMapper.mapInput((A) this, input); MO modelOutput = evaluateInternal(modelInput); O output = outputMapper.mapOutput((A) this, input, modelOutput); return output; } MappedAnalytic(InputMapper<I, A, MI> inputMapper, OutputMapper<I, O, A, MO> outputMapper); }
|
MappedAnalytic implements Analytic<I, O> { @Override @SuppressWarnings("unchecked") public O evaluate(I input) { Assert.notNull(input, "input"); MI modelInput = inputMapper.mapInput((A) this, input); MO modelOutput = evaluateInternal(modelInput); O output = outputMapper.mapOutput((A) this, input, modelOutput); return output; } MappedAnalytic(InputMapper<I, A, MI> inputMapper, OutputMapper<I, O, A, MO> outputMapper); @Override @SuppressWarnings("unchecked") O evaluate(I input); }
|
MappedAnalytic implements Analytic<I, O> { @Override @SuppressWarnings("unchecked") public O evaluate(I input) { Assert.notNull(input, "input"); MI modelInput = inputMapper.mapInput((A) this, input); MO modelOutput = evaluateInternal(modelInput); O output = outputMapper.mapOutput((A) this, input, modelOutput); return output; } MappedAnalytic(InputMapper<I, A, MI> inputMapper, OutputMapper<I, O, A, MO> outputMapper); @Override @SuppressWarnings("unchecked") O evaluate(I input); }
|
@Test public void testExtractMixedFieldNameMappingFromWithDefaultSplitToken() throws Exception { Map<String, String> mapping = mapperWithDefaultSplitToken.extractFieldNameMappingFrom(Arrays.asList("foo:bar", "mambo", "bubu:gaga", "salsa")); assertThat(mapping.size(),is(4)); assertThat(mapping.get("foo"), is("bar")); assertThat(mapping.get("bubu"), is("gaga")); assertThat(mapping.get("mambo"), is("mambo")); assertThat(mapping.get("salsa"), is("salsa")); }
|
protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; }
|
AbstractFieldMappingAwareDataMapper implements Mapper { protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; } }
|
AbstractFieldMappingAwareDataMapper implements Mapper { protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; } AbstractFieldMappingAwareDataMapper(); AbstractFieldMappingAwareDataMapper(String fieldMappingEntrySplitToken); }
|
AbstractFieldMappingAwareDataMapper implements Mapper { protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; } AbstractFieldMappingAwareDataMapper(); AbstractFieldMappingAwareDataMapper(String fieldMappingEntrySplitToken); String getFieldMappingEntrySplitToken(); }
|
AbstractFieldMappingAwareDataMapper implements Mapper { protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; } AbstractFieldMappingAwareDataMapper(); AbstractFieldMappingAwareDataMapper(String fieldMappingEntrySplitToken); String getFieldMappingEntrySplitToken(); static final String DEFAULT_FIELD_NAME_MAPPING_SPLIT_TOKEN; }
|
@Test public void testExtractFieldNameMappingFromWithDefaultSplitToken() throws Exception { Map<String, String> mapping = mapperWithDefaultSplitToken.extractFieldNameMappingFrom(Arrays.asList("foo:bar", "bubu:gaga")); assertThat(mapping.size(),is(2)); assertThat(mapping.get("foo"), is("bar")); assertThat(mapping.get("bubu"), is("gaga")); }
|
protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; }
|
AbstractFieldMappingAwareDataMapper implements Mapper { protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; } }
|
AbstractFieldMappingAwareDataMapper implements Mapper { protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; } AbstractFieldMappingAwareDataMapper(); AbstractFieldMappingAwareDataMapper(String fieldMappingEntrySplitToken); }
|
AbstractFieldMappingAwareDataMapper implements Mapper { protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; } AbstractFieldMappingAwareDataMapper(); AbstractFieldMappingAwareDataMapper(String fieldMappingEntrySplitToken); String getFieldMappingEntrySplitToken(); }
|
AbstractFieldMappingAwareDataMapper implements Mapper { protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; } AbstractFieldMappingAwareDataMapper(); AbstractFieldMappingAwareDataMapper(String fieldMappingEntrySplitToken); String getFieldMappingEntrySplitToken(); static final String DEFAULT_FIELD_NAME_MAPPING_SPLIT_TOKEN; }
|
@Test public void testExtractFieldNameMappingFromWithCustomSplitToken() throws Exception { Map<String, String> mapping = mapperWithCustomSplitToken.extractFieldNameMappingFrom(Arrays.asList("foo->bar", "bubu->gaga")); assertThat(mapping.size(),is(2)); assertThat(mapping.get("foo"), is("bar")); assertThat(mapping.get("bubu"), is("gaga")); }
|
protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; }
|
AbstractFieldMappingAwareDataMapper implements Mapper { protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; } }
|
AbstractFieldMappingAwareDataMapper implements Mapper { protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; } AbstractFieldMappingAwareDataMapper(); AbstractFieldMappingAwareDataMapper(String fieldMappingEntrySplitToken); }
|
AbstractFieldMappingAwareDataMapper implements Mapper { protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; } AbstractFieldMappingAwareDataMapper(); AbstractFieldMappingAwareDataMapper(String fieldMappingEntrySplitToken); String getFieldMappingEntrySplitToken(); }
|
AbstractFieldMappingAwareDataMapper implements Mapper { protected Map<String,String> extractFieldNameMappingFrom(List<String> fieldNameMappingPairs){ Assert.notNull(fieldNameMappingPairs, "fieldNameMappingPairs"); Map<String,String> mapping = new LinkedHashMap<String,String>(); for (String fieldNameMapping : fieldNameMappingPairs) { String fieldNameFrom = fieldNameMapping; String fieldNameTo = fieldNameMapping; if (fieldNameMapping.contains(fieldMappingEntrySplitToken)) { String[] fromTo = fieldNameMapping.split(fieldMappingEntrySplitToken); fieldNameFrom = fromTo[0]; fieldNameTo = fromTo[1]; } mapping.put(fieldNameFrom,fieldNameTo); } return mapping; } AbstractFieldMappingAwareDataMapper(); AbstractFieldMappingAwareDataMapper(String fieldMappingEntrySplitToken); String getFieldMappingEntrySplitToken(); static final String DEFAULT_FIELD_NAME_MAPPING_SPLIT_TOKEN; }
|
@Test public void testValidEmailAddress() { assertTrue(CommonUtils.isValidEmail("[email protected]")); }
|
public static boolean isValidEmail(String emailAddress) { return emailAddress.matches(EMAIL_VALIDATION_REGEX); }
|
CommonUtils { public static boolean isValidEmail(String emailAddress) { return emailAddress.matches(EMAIL_VALIDATION_REGEX); } }
|
CommonUtils { public static boolean isValidEmail(String emailAddress) { return emailAddress.matches(EMAIL_VALIDATION_REGEX); } private CommonUtils(); }
|
CommonUtils { public static boolean isValidEmail(String emailAddress) { return emailAddress.matches(EMAIL_VALIDATION_REGEX); } private CommonUtils(); static String padRight(String inputString, int size, char paddingChar); static String padRight(String string, int size); static String collectionToCommaDelimitedString(Collection<String> list); static void closeReader(Reader reader); static boolean isValidEmail(String emailAddress); static String maskPassword(String password); static String getLocalTime(Date date, TimeZone timeZone); static String getTimeZoneNameWithOffset(TimeZone timeZone); }
|
CommonUtils { public static boolean isValidEmail(String emailAddress) { return emailAddress.matches(EMAIL_VALIDATION_REGEX); } private CommonUtils(); static String padRight(String inputString, int size, char paddingChar); static String padRight(String string, int size); static String collectionToCommaDelimitedString(Collection<String> list); static void closeReader(Reader reader); static boolean isValidEmail(String emailAddress); static String maskPassword(String password); static String getLocalTime(Date date, TimeZone timeZone); static String getTimeZoneNameWithOffset(TimeZone timeZone); static final String NOT_AVAILABLE; }
|
@Test public void testInValidEmailAddress() { assertFalse(CommonUtils.isValidEmail("test123")); }
|
public static boolean isValidEmail(String emailAddress) { return emailAddress.matches(EMAIL_VALIDATION_REGEX); }
|
CommonUtils { public static boolean isValidEmail(String emailAddress) { return emailAddress.matches(EMAIL_VALIDATION_REGEX); } }
|
CommonUtils { public static boolean isValidEmail(String emailAddress) { return emailAddress.matches(EMAIL_VALIDATION_REGEX); } private CommonUtils(); }
|
CommonUtils { public static boolean isValidEmail(String emailAddress) { return emailAddress.matches(EMAIL_VALIDATION_REGEX); } private CommonUtils(); static String padRight(String inputString, int size, char paddingChar); static String padRight(String string, int size); static String collectionToCommaDelimitedString(Collection<String> list); static void closeReader(Reader reader); static boolean isValidEmail(String emailAddress); static String maskPassword(String password); static String getLocalTime(Date date, TimeZone timeZone); static String getTimeZoneNameWithOffset(TimeZone timeZone); }
|
CommonUtils { public static boolean isValidEmail(String emailAddress) { return emailAddress.matches(EMAIL_VALIDATION_REGEX); } private CommonUtils(); static String padRight(String inputString, int size, char paddingChar); static String padRight(String string, int size); static String collectionToCommaDelimitedString(Collection<String> list); static void closeReader(Reader reader); static boolean isValidEmail(String emailAddress); static String maskPassword(String password); static String getLocalTime(Date date, TimeZone timeZone); static String getTimeZoneNameWithOffset(TimeZone timeZone); static final String NOT_AVAILABLE; }
|
@Test public void testPadRightWithNullString() { assertEquals(" ", CommonUtils.padRight(null, 5)); }
|
public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); }
|
CommonUtils { public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); } }
|
CommonUtils { public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); } private CommonUtils(); }
|
CommonUtils { public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); } private CommonUtils(); static String padRight(String inputString, int size, char paddingChar); static String padRight(String string, int size); static String collectionToCommaDelimitedString(Collection<String> list); static void closeReader(Reader reader); static boolean isValidEmail(String emailAddress); static String maskPassword(String password); static String getLocalTime(Date date, TimeZone timeZone); static String getTimeZoneNameWithOffset(TimeZone timeZone); }
|
CommonUtils { public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); } private CommonUtils(); static String padRight(String inputString, int size, char paddingChar); static String padRight(String string, int size); static String collectionToCommaDelimitedString(Collection<String> list); static void closeReader(Reader reader); static boolean isValidEmail(String emailAddress); static String maskPassword(String password); static String getLocalTime(Date date, TimeZone timeZone); static String getTimeZoneNameWithOffset(TimeZone timeZone); static final String NOT_AVAILABLE; }
|
@Test public void testPadRightWithEmptyString() { assertEquals(" ", CommonUtils.padRight("", 5)); }
|
public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); }
|
CommonUtils { public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); } }
|
CommonUtils { public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); } private CommonUtils(); }
|
CommonUtils { public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); } private CommonUtils(); static String padRight(String inputString, int size, char paddingChar); static String padRight(String string, int size); static String collectionToCommaDelimitedString(Collection<String> list); static void closeReader(Reader reader); static boolean isValidEmail(String emailAddress); static String maskPassword(String password); static String getLocalTime(Date date, TimeZone timeZone); static String getTimeZoneNameWithOffset(TimeZone timeZone); }
|
CommonUtils { public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); } private CommonUtils(); static String padRight(String inputString, int size, char paddingChar); static String padRight(String string, int size); static String collectionToCommaDelimitedString(Collection<String> list); static void closeReader(Reader reader); static boolean isValidEmail(String emailAddress); static String maskPassword(String password); static String getLocalTime(Date date, TimeZone timeZone); static String getTimeZoneNameWithOffset(TimeZone timeZone); static final String NOT_AVAILABLE; }
|
@Test public void testPadRight() { assertEquals("foo ", CommonUtils.padRight("foo", 5)); }
|
public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); }
|
CommonUtils { public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); } }
|
CommonUtils { public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); } private CommonUtils(); }
|
CommonUtils { public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); } private CommonUtils(); static String padRight(String inputString, int size, char paddingChar); static String padRight(String string, int size); static String collectionToCommaDelimitedString(Collection<String> list); static void closeReader(Reader reader); static boolean isValidEmail(String emailAddress); static String maskPassword(String password); static String getLocalTime(Date date, TimeZone timeZone); static String getTimeZoneNameWithOffset(TimeZone timeZone); }
|
CommonUtils { public static String padRight(String inputString, int size, char paddingChar) { final String stringToPad; if (inputString == null) { stringToPad = ""; } else { stringToPad = inputString; } StringBuilder padded = new StringBuilder(stringToPad); while (padded.length() < size) { padded.append(paddingChar); } return padded.toString(); } private CommonUtils(); static String padRight(String inputString, int size, char paddingChar); static String padRight(String string, int size); static String collectionToCommaDelimitedString(Collection<String> list); static void closeReader(Reader reader); static boolean isValidEmail(String emailAddress); static String maskPassword(String password); static String getLocalTime(Date date, TimeZone timeZone); static String getTimeZoneNameWithOffset(TimeZone timeZone); static final String NOT_AVAILABLE; }
|
@Test public void testMaskPassword() { assertEquals("******", CommonUtils.maskPassword("foobar")); }
|
public static String maskPassword(String password) { int lengthOfPassword = password.length(); StringBuilder stringBuilder = new StringBuilder(lengthOfPassword); for (int i = 0; i < lengthOfPassword; i++) { stringBuilder.append('*'); } return stringBuilder.toString(); }
|
CommonUtils { public static String maskPassword(String password) { int lengthOfPassword = password.length(); StringBuilder stringBuilder = new StringBuilder(lengthOfPassword); for (int i = 0; i < lengthOfPassword; i++) { stringBuilder.append('*'); } return stringBuilder.toString(); } }
|
CommonUtils { public static String maskPassword(String password) { int lengthOfPassword = password.length(); StringBuilder stringBuilder = new StringBuilder(lengthOfPassword); for (int i = 0; i < lengthOfPassword; i++) { stringBuilder.append('*'); } return stringBuilder.toString(); } private CommonUtils(); }
|
CommonUtils { public static String maskPassword(String password) { int lengthOfPassword = password.length(); StringBuilder stringBuilder = new StringBuilder(lengthOfPassword); for (int i = 0; i < lengthOfPassword; i++) { stringBuilder.append('*'); } return stringBuilder.toString(); } private CommonUtils(); static String padRight(String inputString, int size, char paddingChar); static String padRight(String string, int size); static String collectionToCommaDelimitedString(Collection<String> list); static void closeReader(Reader reader); static boolean isValidEmail(String emailAddress); static String maskPassword(String password); static String getLocalTime(Date date, TimeZone timeZone); static String getTimeZoneNameWithOffset(TimeZone timeZone); }
|
CommonUtils { public static String maskPassword(String password) { int lengthOfPassword = password.length(); StringBuilder stringBuilder = new StringBuilder(lengthOfPassword); for (int i = 0; i < lengthOfPassword; i++) { stringBuilder.append('*'); } return stringBuilder.toString(); } private CommonUtils(); static String padRight(String inputString, int size, char paddingChar); static String padRight(String string, int size); static String collectionToCommaDelimitedString(Collection<String> list); static void closeReader(Reader reader); static boolean isValidEmail(String emailAddress); static String maskPassword(String password); static String getLocalTime(Date date, TimeZone timeZone); static String getTimeZoneNameWithOffset(TimeZone timeZone); static final String NOT_AVAILABLE; }
|
@Test public void testRenderTextTable() { final Table table = new Table(); table.addHeader(1, new TableHeader("Tap Name")) .addHeader(2, new TableHeader("Stream Name")) .addHeader(3, new TableHeader("Tap Definition")); for (int i = 1; i <= 3; i++) { final TableRow row = new TableRow(); row.addValue(1, "tap" + i) .addValue(2, "ticktock") .addValue(3, "tap@ticktock|log"); table.getRows().add(row); } String expectedTableAsString = null; final InputStream inputStream = getClass() .getClassLoader() .getResourceAsStream("testRenderTextTable-expected-output.txt"); assertNotNull("The inputstream is null.", inputStream); try { expectedTableAsString = FileCopyUtils.copyToString(new InputStreamReader(inputStream)); } catch (IOException e) { e.printStackTrace(); fail(); } final String tableRenderedAsString = UiUtils.renderTextTable(table); assertEquals(expectedTableAsString.replaceAll("\r", ""), tableRenderedAsString); }
|
public static String renderTextTable(Table table) { return renderTextTable(table, true); }
|
UiUtils { public static String renderTextTable(Table table) { return renderTextTable(table, true); } }
|
UiUtils { public static String renderTextTable(Table table) { return renderTextTable(table, true); } private UiUtils(); }
|
UiUtils { public static String renderTextTable(Table table) { return renderTextTable(table, true); } private UiUtils(); static String renderMapDataAsTable(List<Map<String, Object>> data, List<String> columns); static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader,
int lastColumnMaxWidth); static String renderParameterInfoDataAsTable(Map<String, String> parameters); static String renderTextTable(Table table); static String renderTextTable(Table table, boolean withHeader); static String getHeaderBorder(Map<Integer, TableHeader> headers); }
|
UiUtils { public static String renderTextTable(Table table) { return renderTextTable(table, true); } private UiUtils(); static String renderMapDataAsTable(List<Map<String, Object>> data, List<String> columns); static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader,
int lastColumnMaxWidth); static String renderParameterInfoDataAsTable(Map<String, String> parameters); static String renderTextTable(Table table); static String renderTextTable(Table table, boolean withHeader); static String getHeaderBorder(Map<Integer, TableHeader> headers); static final String HORIZONTAL_LINE; static final int COLUMN_1; static final int COLUMN_2; static final int COLUMN_3; static final int COLUMN_4; static final int COLUMN_5; static final int COLUMN_6; }
|
@Test public void testRenderTextTableWithSingleColumn() { final Table table = new Table(); table.addHeader(1, new TableHeader("Gauge name")); final TableRow row = new TableRow(); row.addValue(1, "simplegauge"); table.getRows().add(row); String expectedTableAsString = null; final InputStream inputStream = getClass() .getClassLoader() .getResourceAsStream("testRenderTextTable-single-column-expected-output.txt"); assertNotNull("The inputstream is null.", inputStream); try { expectedTableAsString = FileCopyUtils.copyToString(new InputStreamReader(inputStream)); } catch (IOException e) { e.printStackTrace(); fail(); } final String tableRenderedAsString = UiUtils.renderTextTable(table); assertEquals(expectedTableAsString.replaceAll("\r", ""), tableRenderedAsString); }
|
public static String renderTextTable(Table table) { return renderTextTable(table, true); }
|
UiUtils { public static String renderTextTable(Table table) { return renderTextTable(table, true); } }
|
UiUtils { public static String renderTextTable(Table table) { return renderTextTable(table, true); } private UiUtils(); }
|
UiUtils { public static String renderTextTable(Table table) { return renderTextTable(table, true); } private UiUtils(); static String renderMapDataAsTable(List<Map<String, Object>> data, List<String> columns); static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader,
int lastColumnMaxWidth); static String renderParameterInfoDataAsTable(Map<String, String> parameters); static String renderTextTable(Table table); static String renderTextTable(Table table, boolean withHeader); static String getHeaderBorder(Map<Integer, TableHeader> headers); }
|
UiUtils { public static String renderTextTable(Table table) { return renderTextTable(table, true); } private UiUtils(); static String renderMapDataAsTable(List<Map<String, Object>> data, List<String> columns); static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader,
int lastColumnMaxWidth); static String renderParameterInfoDataAsTable(Map<String, String> parameters); static String renderTextTable(Table table); static String renderTextTable(Table table, boolean withHeader); static String getHeaderBorder(Map<Integer, TableHeader> headers); static final String HORIZONTAL_LINE; static final int COLUMN_1; static final int COLUMN_2; static final int COLUMN_3; static final int COLUMN_4; static final int COLUMN_5; static final int COLUMN_6; }
|
@Test public void testRenderTextTableWithSingleColumnAndWidthOf4() { final Table table = new Table(); final TableHeader tableHeader = new TableHeader("Gauge name"); tableHeader.setMaxWidth(4); table.addHeader(1, tableHeader); final TableRow row = new TableRow(); row.addValue(1, "simplegauge"); table.getRows().add(row); String expectedTableAsString = null; final InputStream inputStream = getClass() .getClassLoader() .getResourceAsStream("testRenderTextTable-single-column-width4-expected-output.txt"); assertNotNull("The inputstream is null.", inputStream); try { expectedTableAsString = FileCopyUtils.copyToString(new InputStreamReader(inputStream)); } catch (IOException e) { e.printStackTrace(); fail(); } final String tableRenderedAsString = UiUtils.renderTextTable(table); assertEquals(expectedTableAsString.replaceAll("\r", ""), tableRenderedAsString); }
|
public static String renderTextTable(Table table) { return renderTextTable(table, true); }
|
UiUtils { public static String renderTextTable(Table table) { return renderTextTable(table, true); } }
|
UiUtils { public static String renderTextTable(Table table) { return renderTextTable(table, true); } private UiUtils(); }
|
UiUtils { public static String renderTextTable(Table table) { return renderTextTable(table, true); } private UiUtils(); static String renderMapDataAsTable(List<Map<String, Object>> data, List<String> columns); static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader,
int lastColumnMaxWidth); static String renderParameterInfoDataAsTable(Map<String, String> parameters); static String renderTextTable(Table table); static String renderTextTable(Table table, boolean withHeader); static String getHeaderBorder(Map<Integer, TableHeader> headers); }
|
UiUtils { public static String renderTextTable(Table table) { return renderTextTable(table, true); } private UiUtils(); static String renderMapDataAsTable(List<Map<String, Object>> data, List<String> columns); static String renderParameterInfoDataAsTable(Map<String, String> parameters, boolean withHeader,
int lastColumnMaxWidth); static String renderParameterInfoDataAsTable(Map<String, String> parameters); static String renderTextTable(Table table); static String renderTextTable(Table table, boolean withHeader); static String getHeaderBorder(Map<Integer, TableHeader> headers); static final String HORIZONTAL_LINE; static final int COLUMN_1; static final int COLUMN_2; static final int COLUMN_3; static final int COLUMN_4; static final int COLUMN_5; static final int COLUMN_6; }
|
@Test public void testGetOperatingSystem() { assertEquals(LibreOfficeLauncherHelper.OS_LINUX, LibreOfficeLauncherHelper.getOperatingSystem("linux")); assertEquals(LibreOfficeLauncherHelper.OS_LINUX, LibreOfficeLauncherHelper.getOperatingSystem("Linux")); assertEquals(LibreOfficeLauncherHelper.OS_WINDOWS, LibreOfficeLauncherHelper.getOperatingSystem("Windows XP")); assertEquals(LibreOfficeLauncherHelper.OS_WINDOWS, LibreOfficeLauncherHelper.getOperatingSystem("windows 5.1")); assertEquals(LibreOfficeLauncherHelper.OS_MACOSX, LibreOfficeLauncherHelper.getOperatingSystem("mac os x")); assertEquals(LibreOfficeLauncherHelper.OS_MACOSX, LibreOfficeLauncherHelper.getOperatingSystem("Mac OS X")); assertEquals(LibreOfficeLauncherHelper.OS_UNSUPPORTED, LibreOfficeLauncherHelper.getOperatingSystem("Solaris")); assertEquals(LibreOfficeLauncherHelper.OS_UNSUPPORTED, LibreOfficeLauncherHelper.getOperatingSystem("")); }
|
public static String getOperatingSystem(String operatingSystemIndentifier) { if ("linux".equalsIgnoreCase(operatingSystemIndentifier)) { return OS_LINUX; } if (operatingSystemIndentifier != null && operatingSystemIndentifier.toLowerCase().contains("windows")) { return OS_WINDOWS; } else if (operatingSystemIndentifier != null && operatingSystemIndentifier.toLowerCase().contains("mac os x")) { return OS_MACOSX; } else { return OS_UNSUPPORTED; } }
|
LibreOfficeLauncherHelper { public static String getOperatingSystem(String operatingSystemIndentifier) { if ("linux".equalsIgnoreCase(operatingSystemIndentifier)) { return OS_LINUX; } if (operatingSystemIndentifier != null && operatingSystemIndentifier.toLowerCase().contains("windows")) { return OS_WINDOWS; } else if (operatingSystemIndentifier != null && operatingSystemIndentifier.toLowerCase().contains("mac os x")) { return OS_MACOSX; } else { return OS_UNSUPPORTED; } } }
|
LibreOfficeLauncherHelper { public static String getOperatingSystem(String operatingSystemIndentifier) { if ("linux".equalsIgnoreCase(operatingSystemIndentifier)) { return OS_LINUX; } if (operatingSystemIndentifier != null && operatingSystemIndentifier.toLowerCase().contains("windows")) { return OS_WINDOWS; } else if (operatingSystemIndentifier != null && operatingSystemIndentifier.toLowerCase().contains("mac os x")) { return OS_MACOSX; } else { return OS_UNSUPPORTED; } } }
|
LibreOfficeLauncherHelper { public static String getOperatingSystem(String operatingSystemIndentifier) { if ("linux".equalsIgnoreCase(operatingSystemIndentifier)) { return OS_LINUX; } if (operatingSystemIndentifier != null && operatingSystemIndentifier.toLowerCase().contains("windows")) { return OS_WINDOWS; } else if (operatingSystemIndentifier != null && operatingSystemIndentifier.toLowerCase().contains("mac os x")) { return OS_MACOSX; } else { return OS_UNSUPPORTED; } } static String getOperatingSystem(String operatingSystemIndentifier); static String generateLibreOfficeOpenUrl(String cmisUrl, String repositoryId, String filePath); }
|
LibreOfficeLauncherHelper { public static String getOperatingSystem(String operatingSystemIndentifier) { if ("linux".equalsIgnoreCase(operatingSystemIndentifier)) { return OS_LINUX; } if (operatingSystemIndentifier != null && operatingSystemIndentifier.toLowerCase().contains("windows")) { return OS_WINDOWS; } else if (operatingSystemIndentifier != null && operatingSystemIndentifier.toLowerCase().contains("mac os x")) { return OS_MACOSX; } else { return OS_UNSUPPORTED; } } static String getOperatingSystem(String operatingSystemIndentifier); static String generateLibreOfficeOpenUrl(String cmisUrl, String repositoryId, String filePath); static final String OS_WINDOWS; static final String OS_LINUX; static final String OS_MACOSX; static final String OS_UNSUPPORTED; }
|
@Test public void testGenerateLibreOfficeOpenUrl() throws UnsupportedEncodingException { assertEquals("vnd.libreoffice.cmis: LibreOfficeLauncherHelper.generateLibreOfficeOpenUrl("http: "/Sites/libreoffice-test/documentLibrary/Testdocument.odt")); }
|
public static String generateLibreOfficeOpenUrl(String cmisUrl, String repositoryId, String filePath) throws UnsupportedEncodingException { StringBuilder openUrlSb = new StringBuilder(); openUrlSb.append(LibreOfficeLauncherHelper.LIBREOFFICE_HANDLER); openUrlSb.append(": StringBuilder cmisUrlSb = new StringBuilder(); cmisUrlSb.append(cmisUrl); cmisUrlSb.append("#"); cmisUrlSb.append(repositoryId); String urlEncodedString = URLEncoder.encode(cmisUrlSb.toString(), "UTF-8").replaceAll("\\+", "%20"); openUrlSb.append(urlEncodedString + filePath); return openUrlSb.toString(); }
|
LibreOfficeLauncherHelper { public static String generateLibreOfficeOpenUrl(String cmisUrl, String repositoryId, String filePath) throws UnsupportedEncodingException { StringBuilder openUrlSb = new StringBuilder(); openUrlSb.append(LibreOfficeLauncherHelper.LIBREOFFICE_HANDLER); openUrlSb.append(": StringBuilder cmisUrlSb = new StringBuilder(); cmisUrlSb.append(cmisUrl); cmisUrlSb.append("#"); cmisUrlSb.append(repositoryId); String urlEncodedString = URLEncoder.encode(cmisUrlSb.toString(), "UTF-8").replaceAll("\\+", "%20"); openUrlSb.append(urlEncodedString + filePath); return openUrlSb.toString(); } }
|
LibreOfficeLauncherHelper { public static String generateLibreOfficeOpenUrl(String cmisUrl, String repositoryId, String filePath) throws UnsupportedEncodingException { StringBuilder openUrlSb = new StringBuilder(); openUrlSb.append(LibreOfficeLauncherHelper.LIBREOFFICE_HANDLER); openUrlSb.append(": StringBuilder cmisUrlSb = new StringBuilder(); cmisUrlSb.append(cmisUrl); cmisUrlSb.append("#"); cmisUrlSb.append(repositoryId); String urlEncodedString = URLEncoder.encode(cmisUrlSb.toString(), "UTF-8").replaceAll("\\+", "%20"); openUrlSb.append(urlEncodedString + filePath); return openUrlSb.toString(); } }
|
LibreOfficeLauncherHelper { public static String generateLibreOfficeOpenUrl(String cmisUrl, String repositoryId, String filePath) throws UnsupportedEncodingException { StringBuilder openUrlSb = new StringBuilder(); openUrlSb.append(LibreOfficeLauncherHelper.LIBREOFFICE_HANDLER); openUrlSb.append(": StringBuilder cmisUrlSb = new StringBuilder(); cmisUrlSb.append(cmisUrl); cmisUrlSb.append("#"); cmisUrlSb.append(repositoryId); String urlEncodedString = URLEncoder.encode(cmisUrlSb.toString(), "UTF-8").replaceAll("\\+", "%20"); openUrlSb.append(urlEncodedString + filePath); return openUrlSb.toString(); } static String getOperatingSystem(String operatingSystemIndentifier); static String generateLibreOfficeOpenUrl(String cmisUrl, String repositoryId, String filePath); }
|
LibreOfficeLauncherHelper { public static String generateLibreOfficeOpenUrl(String cmisUrl, String repositoryId, String filePath) throws UnsupportedEncodingException { StringBuilder openUrlSb = new StringBuilder(); openUrlSb.append(LibreOfficeLauncherHelper.LIBREOFFICE_HANDLER); openUrlSb.append(": StringBuilder cmisUrlSb = new StringBuilder(); cmisUrlSb.append(cmisUrl); cmisUrlSb.append("#"); cmisUrlSb.append(repositoryId); String urlEncodedString = URLEncoder.encode(cmisUrlSb.toString(), "UTF-8").replaceAll("\\+", "%20"); openUrlSb.append(urlEncodedString + filePath); return openUrlSb.toString(); } static String getOperatingSystem(String operatingSystemIndentifier); static String generateLibreOfficeOpenUrl(String cmisUrl, String repositoryId, String filePath); static final String OS_WINDOWS; static final String OS_LINUX; static final String OS_MACOSX; static final String OS_UNSUPPORTED; }
|
@Test(enabled = true) private void test_IsDR() { plugin = new PlatformHADRCrawlerPlugin(); Platform platform = new Platform(); List<String> activeClouds = new ArrayList<String>(); activeClouds.add("dc1-TestCloud1"); activeClouds.add("dc1-TestCloud2"); activeClouds.add("dc2-TestCloud1"); activeClouds.add("dc2-TestCloud2"); platform.setActiveClouds(activeClouds); assertEquals(plugin.IsDR(platform), "DR"); }
|
public String IsDR(Platform platform) { String activeCloudsListForPlatform = platform.getActiveClouds().toString().toLowerCase(); log.info("activeCloudsListForPlatform: " + activeCloudsListForPlatform.toString()); int i = 0; for (String dataCenter : dataCentersArr) { if (activeCloudsListForPlatform.contains(dataCenter)) { i++; } } if (i >= 2) { return "DR"; } return "Non-DR"; }
|
PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String IsDR(Platform platform) { String activeCloudsListForPlatform = platform.getActiveClouds().toString().toLowerCase(); log.info("activeCloudsListForPlatform: " + activeCloudsListForPlatform.toString()); int i = 0; for (String dataCenter : dataCentersArr) { if (activeCloudsListForPlatform.contains(dataCenter)) { i++; } } if (i >= 2) { return "DR"; } return "Non-DR"; } }
|
PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String IsDR(Platform platform) { String activeCloudsListForPlatform = platform.getActiveClouds().toString().toLowerCase(); log.info("activeCloudsListForPlatform: " + activeCloudsListForPlatform.toString()); int i = 0; for (String dataCenter : dataCentersArr) { if (activeCloudsListForPlatform.contains(dataCenter)) { i++; } } if (i >= 2) { return "DR"; } return "Non-DR"; } PlatformHADRCrawlerPlugin(); }
|
PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String IsDR(Platform platform) { String activeCloudsListForPlatform = platform.getActiveClouds().toString().toLowerCase(); log.info("activeCloudsListForPlatform: " + activeCloudsListForPlatform.toString()); int i = 0; for (String dataCenter : dataCentersArr) { if (activeCloudsListForPlatform.contains(dataCenter)) { i++; } } if (i >= 2) { return "DR"; } return "Non-DR"; } PlatformHADRCrawlerPlugin(); SearchDal getSearchDal(); void setSearchDal(SearchDal searchDal); void readConfig(); void processEnvironment(Environment env, Map<String, Organization> organizationsMapCache); void processPlatformsInEnv(Environment env,
Map<String, Organization> organizationsMapCache); String getOOURL(String path); String parseAssemblyNameFromNsPath(String path); String IsDR(Platform platform); String IsHA(Platform platform); void saveToElasticSearch(PlatformHADRRecord platformHADRRecord, String platformCId); void createIndexInElasticSearch(); PlatformHADRRecord setCloudCategories(PlatformHADRRecord platformHADRRecord,
Map<String, Cloud> clouds); Map<String, Object> getPlatformTechDebtForEnvironment(Platform platform, Environment env); boolean isNonProdEnvUsingProdutionClouds(Map<String, Cloud> cloudsMap); boolean prodProfileWithNonProdClouds(Map<String, Cloud> cloudsMap); boolean isHadrPluginEnabled(); boolean isHadrEsEnabled(); String getProdDataCentersList(); String getHadrElasticSearchIndexName(); String[] getDataCentersArr(); void setHadrEsEnabled(boolean isHadrEsEnabled); String getHadrElasticSearchIndexMappings(); String getIsHALabel(); String getIsDRLabel(); String getIsAutoRepairEnabledLabel(); String getIsAutoReplaceEnabledLabel(); String getIsProdCloudInNonProdEnvLabel(); String getIsProdProfileWithNonProdCloudsLabel(); String getEnvironmentProdProfileFilter(); String getDateTimeFormatPattern(); }
|
PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String IsDR(Platform platform) { String activeCloudsListForPlatform = platform.getActiveClouds().toString().toLowerCase(); log.info("activeCloudsListForPlatform: " + activeCloudsListForPlatform.toString()); int i = 0; for (String dataCenter : dataCentersArr) { if (activeCloudsListForPlatform.contains(dataCenter)) { i++; } } if (i >= 2) { return "DR"; } return "Non-DR"; } PlatformHADRCrawlerPlugin(); SearchDal getSearchDal(); void setSearchDal(SearchDal searchDal); void readConfig(); void processEnvironment(Environment env, Map<String, Organization> organizationsMapCache); void processPlatformsInEnv(Environment env,
Map<String, Organization> organizationsMapCache); String getOOURL(String path); String parseAssemblyNameFromNsPath(String path); String IsDR(Platform platform); String IsHA(Platform platform); void saveToElasticSearch(PlatformHADRRecord platformHADRRecord, String platformCId); void createIndexInElasticSearch(); PlatformHADRRecord setCloudCategories(PlatformHADRRecord platformHADRRecord,
Map<String, Cloud> clouds); Map<String, Object> getPlatformTechDebtForEnvironment(Platform platform, Environment env); boolean isNonProdEnvUsingProdutionClouds(Map<String, Cloud> cloudsMap); boolean prodProfileWithNonProdClouds(Map<String, Cloud> cloudsMap); boolean isHadrPluginEnabled(); boolean isHadrEsEnabled(); String getProdDataCentersList(); String getHadrElasticSearchIndexName(); String[] getDataCentersArr(); void setHadrEsEnabled(boolean isHadrEsEnabled); String getHadrElasticSearchIndexMappings(); String getIsHALabel(); String getIsDRLabel(); String getIsAutoRepairEnabledLabel(); String getIsAutoReplaceEnabledLabel(); String getIsProdCloudInNonProdEnvLabel(); String getIsProdProfileWithNonProdCloudsLabel(); String getEnvironmentProdProfileFilter(); String getDateTimeFormatPattern(); }
|
@Test public void validateReadingTestYaml() throws Exception { OneOpsYamlReader reader = new OneOpsYamlReader(); TestCase testCaseYaml = reader .read(yaml("src/test/yaml/oo-v2", "testcase.yaml"), TestCase.class); assertEquals("Evaluate optional component add/delete", testCaseYaml.getDescription()); assertEquals("false", testCaseYaml.getRandomcloud()); assertEquals("pulldesign", testCaseYaml.getTags().get(0)); assertTrue(testCaseYaml.getClouds().keySet().contains("cloud0")); List<Cloud> clouds = Lists.newArrayList(testCaseYaml.getClouds().values()); assertEquals(1, clouds.get(0).getDeploymentorder()); assertTrue(testCaseYaml.getTemplates().keySet().contains("template-1.yaml")); List<Template> templates = Lists.newArrayList(testCaseYaml.getTemplates().values()); Template template = templates.get(0); assertEquals("evaluate add of optional component user-temp", template.getAssertions().get("addusercomponent").getMessage()); }
|
public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } T read(File yamlfile, Class<T> yamlModelClass); }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } T read(File yamlfile, Class<T> yamlModelClass); }
|
@Test public void validateReadingTestOldBooYaml1() throws Exception { OneOpsYamlReader reader = new OneOpsYamlReader(); BooYaml booYaml = reader.read(yaml("src/test/yaml/boo", "assembly.yaml"), BooYaml.class); assertEquals(booYaml.getBoo().getEnvironment_name(), "environment_name"); Map<String, String> tags = Maps.newHashMap(); tags.put("tag-key1", "tag-value1"); tags.put("tag-key2", "tag-value2"); tags.put("tag-key3", "tag-value3"); tags.put("tag-key4", "tag-value4"); assertEquals(booYaml.getAssembly().getTags(), tags); List<BooPlatform> platformList = booYaml.getPlatformList(); BooPlatform booPlatform0 = platformList.get(0); assertEquals(booPlatform0.getName(), "platform-0"); assertEquals(booPlatform0.getPack(), "pack-platform-0"); assertEquals(booPlatform0.getSource(), "source"); Map<String, Map<String, Object>> components = booPlatform0.getComponents(); Map<String, Object> component0 = components.get("component-0"); assertEquals(component0.get("config-0"), "platform-0-config-0-value"); Map<String, BooAttachment> attachments = booPlatform0.getAttachments(); BooAttachment booAttachment = attachments.get("component-0"); assertEquals(booAttachment.getName(), "attachment1"); Map<String, Object> user = components.get("user"); Map<String, String> userComp = Maps.newHashMap(); userComp.put("username", "user1"); userComp.put("authorized_keys", "[\"\"]"); assertEquals(user.get("user1"), userComp); List<BooScale> scaleList = booYaml.getScaleList(); BooScale booScale = scaleList.get(0); assertEquals(booScale.getPlatformName(), "platform-0"); assertEquals(booScale.getComponentName(), "compute"); assertEquals(booScale.getMin(), "2"); assertEquals(booScale.getCurrent(), "2"); List<BooEnvironment> environmentList = booYaml.getEnvironmentList(); BooEnvironment environment0 = environmentList.get(0); assertEquals(environment0.getName(), booYaml.getBoo().getEnvironment_name()); assertEquals(environment0.getProfile(), "DEV"); List<BooCloud> cloudList = environment0.getCloudList(); BooCloud cloud0 = cloudList.get(0); assertEquals(cloud0.getName(), "dev-cdc002"); assertEquals(cloud0.getPriority(), "1"); assertEquals(cloud0.getDpmt_order(), "1"); assertEquals(cloud0.getPct_scale(), "30"); List<BooPlatform> ep0 = environment0.getPlatformList(); BooPlatform ep = ep0.get(0); assertEquals(ep.getName(), "platform-0"); Map<String, String> autoHealing = Maps.newHashMap(); autoHealing.put("autorepair", "false"); autoHealing.put("autoreplace", "true"); autoHealing.put("replace_after_minutes", "60"); autoHealing.put("replace_after_repairs", "4"); assertEquals(ep.getAuto_healing(), autoHealing); Map<String, Map<String, Object>> epc0 = ep.getComponents(); Map<String, Object> lbConfig = epc0.get("lb"); assertEquals(lbConfig.get("ecv_map"), "{\"8080\":\"GET /\"}"); BooModelTransformer bmt = new BooModelTransformer(); OneOps oneops = bmt.convert(booYaml); assertEquals("auth-key", oneops.getApikey()); assertEquals("https: assertEquals("local-org", oneops.getOrganization()); Assembly assembly = oneops.getAssembly(); assertEquals("assembly-name", assembly.getName()); }
|
public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } T read(File yamlfile, Class<T> yamlModelClass); }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } T read(File yamlfile, Class<T> yamlModelClass); }
|
@Test public void validateReadingTestOldBooYaml2() throws Exception { OneOpsYamlReader reader = new OneOpsYamlReader(); BooYaml booYaml = reader.read(yaml("src/test/yaml/boo", "assembly2.yaml"), BooYaml.class); assertEquals(booYaml.getBoo().getEnvironment_name(), "environment_name"); Map<String, String> tags = Maps.newHashMap(); tags.put("tag-key1", "tag-value1"); tags.put("tag-key2", "tag-value2"); tags.put("tag-key3", "tag-value3"); tags.put("tag-key4", "tag-value4"); assertEquals(booYaml.getAssembly().getTags(), tags); List<BooPlatform> platformList = booYaml.getPlatformList(); BooPlatform booPlatform0 = platformList.get(0); assertEquals(booPlatform0.getName(), "platform-0"); assertEquals(booPlatform0.getPack(), "pack-platform-0"); assertEquals(booPlatform0.getSource(), "source"); Map<String, Map<String, Object>> components = booPlatform0.getComponents(); Map<String, Object> component0 = components.get("component-0"); assertEquals(component0.get("config-0"), "platform-0-config-0-value"); Map<String, Object> user = components.get("user"); Map<String, String> userComp = Maps.newHashMap(); userComp.put("username", "user1"); userComp.put("authorized_keys", "[\"\"]"); assertEquals(user.get("user1"), userComp); List<BooEnvironment> environmentList = booYaml.getEnvironmentList(); BooEnvironment environment0 = environmentList.get(0); assertEquals(environment0.getName(), "dev"); assertEquals(environment0.getAvailability(), "redundant"); List<BooCloud> cloudList = environment0.getCloudList(); BooCloud cloud0 = cloudList.get(0); assertEquals(cloud0.getName(), "stub-dfw2a"); assertEquals(cloud0.getPriority(), "1"); assertEquals(cloud0.getDpmt_order(), "1"); assertEquals(cloud0.getPct_scale(), "100"); List<BooPlatform> ep0 = environment0.getPlatformList(); BooPlatform ep = ep0.get(0); assertEquals(ep.getName(), "platform-0"); Map<String, String> autoHealing = Maps.newHashMap(); autoHealing.put("autorepair", "false"); autoHealing.put("autoreplace", "true"); autoHealing.put("replace_after_minutes", "60"); autoHealing.put("replace_after_repairs", "4"); assertEquals(ep.getAuto_healing(), autoHealing); Map<String, Map<String, Object>> epc0 = ep.getComponents(); Map<String, Object> lbConfig = epc0.get("lb"); assertEquals(lbConfig.get("ecv_map"), "{\"8080\":\"GET /\"}"); List<BooScale> scaleList = ep.getScaleList(); BooScale booScale = scaleList.get(0); assertEquals(booScale.getPlatformName(), "platform-0"); assertEquals(booScale.getComponentName(), "compute"); assertEquals(booScale.getMin(), "1"); assertEquals(booScale.getCurrent(), "3"); BooModelTransformer bmt = new BooModelTransformer(); OneOps oneops = bmt.convert(booYaml); assertEquals("auth-key", oneops.getApikey()); assertEquals("https: assertEquals("local-org", oneops.getOrganization()); Assembly assembly = oneops.getAssembly(); assertEquals("assembly-name", assembly.getName()); }
|
public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } T read(File yamlfile, Class<T> yamlModelClass); }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } T read(File yamlfile, Class<T> yamlModelClass); }
|
@Test public void validateReadingAssembly() throws Exception { OneOpsYamlReader reader = new OneOpsYamlReader(); OneOps oneops = reader.read(yaml("src/test/yaml/oo-v2", "assembly.yaml"), OneOps.class); assertEquals("auth-key", oneops.getApikey()); assertEquals("https: assertEquals("local-org", oneops.getOrganization()); Assembly assembly = oneops.getAssembly(); assertEquals("assembly-name", assembly.getName()); Map<String, String> variables = assembly.getVariables(); assertEquals("variable-value-0", variables.get("variable-0")); assertEquals("variable-value-1", variables.get("variable-1")); Map<String, String> encryptedVariables = assembly.getEncryptedvariables(); assertEquals("encrypted-variable-value-0", encryptedVariables.get("encrypted-variable-0")); Map<String, String> tags = assembly.getTags(); assertEquals("tag-value-0", tags.get("tag-0")); assertEquals("tag-value-1", tags.get("tag-1")); List<Platform> platforms = assembly.getPlatformList(); Platform p0 = platforms.get(0); assertEquals("platform-0", p0.getName()); assertEquals("source/pack-platform-0", p0.getPack()); assertEquals("1", p0.getPackVersion()); List<String> links = p0.getLinks(); assertEquals("platform-0-link-0", links.get(0)); assertEquals("platform-0-link-1", links.get(1)); Map<String, String> platformVariables = p0.getVariables(); assertEquals("pack-platform-0-variable-0-value", platformVariables.get("pack-platform-variable-0")); assertEquals("pack-platform-0-variable-1-value", platformVariables.get("pack-platform-variable-1")); Map<String, String> encryptedPlatformVariables = p0.getEncryptedvariables(); assertEquals("encrypted-pack-platform-0-variable-0-value", encryptedPlatformVariables.get("encrypted-pack-platform-variable-0")); List<Component> components = p0.getComponentList(); Component c0 = components.get(0); assertEquals("component-0", c0.getId()); Map<String, String> config = c0.getConfiguration(); assertEquals("platform-0-config-0-value", config.get("config-0")); assertEquals("platform-0-config-1-value", config.get("config-1")); assertEquals("platform-1", platforms.get(1).getName()); assertEquals("1", platforms.get(1).getConfiguration().get("version")); List<Component> pcomps = platforms.get(1).getComponentList(); List<Attachment> pAttachments = pcomps.get(0).getAttachmentList(); Attachment pa0 = pAttachments.get(0); assertEquals("attachment1", pa0.getId()); Map<String, String> paconfig0 = pa0.getConfiguration(); assertEquals("before-add,before-update,before-replace", paconfig0.get("run_on")); List<Environment> environments = assembly.getEnvironmentList(); Environment e0 = environments.get(0); assertEquals("environment-0", e0.getName()); assertTrue(e0.isGlobaldns()); assertEquals("redundant", e0.getAvailability()); assertEquals("variable-new-value-0", e0.getVariables().get("variable-0")); assertEquals("encrypted-variable-new-value-0", e0.getEncryptedvariables().get("encrypted-variable-0")); List<Platform> environmentPlatforms = e0.getPlatformList(); Platform ep0 = environmentPlatforms.get(0); assertEquals("platform-1", ep0.getName()); assertEquals("false", ep0.getEnable()); Map<String, String> ep0config = ep0.getConfiguration(); assertEquals("redundant", ep0config.get("availability")); assertEquals("false", ep0config.get("autorepair")); assertEquals("true", ep0config.get("autoreplace")); assertEquals("55", ep0config.get("replace_after_minutes")); assertEquals("4", ep0config.get("replace_after_repairs")); Map<String, Map<String, String>> scale = ep0.getScale(); Map<String, String> computeScale = scale.get("compute"); assertEquals("3", computeScale.get("current")); assertEquals("1", computeScale.get("min")); assertEquals("5", computeScale.get("max")); assertEquals("pack-platform-0-variable-0-new-value", ep0.getVariables().get("pack-platform-variable-0")); List<Component> environmentComponents = ep0.getComponentList(); Component epc0 = environmentComponents.get(0); assertEquals("component-0", epc0.getId()); assertEquals("component-0-type", epc0.getType()); assertEquals("true", epc0.getTouch()); Map<String, String> config0 = epc0.getConfiguration(); assertEquals("platform-1-config-0-value", config0.get("config-2")); assertEquals("platform-1-config-1-value", config0.get("config-3")); List<Attachment> epAttachments = epc0.getAttachmentList(); Attachment epa0 = epAttachments.get(0); assertEquals("attachment1", epa0.getId()); Map<String, String> epaconfig0 = epa0.getConfiguration(); assertEquals("before-add,before-update,before-replace", epaconfig0.get("run_on")); List<Cloud> clouds = e0.getCloudList(); Cloud cloud = clouds.get(0); assertEquals(1, cloud.getPriority()); assertEquals(1, cloud.getDeploymentorder()); assertEquals(100, cloud.getScalepercentage()); }
|
public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } T read(File yamlfile, Class<T> yamlModelClass); }
|
OneOpsYamlReader { public <T> T read(File yamlfile, Class<T> yamlModelClass) throws FileNotFoundException { Yaml yaml = new Yaml(); T yamlmodel = yaml.loadAs(new FileInputStream(yamlfile), yamlModelClass); return yamlmodel; } T read(File yamlfile, Class<T> yamlModelClass); }
|
@Test public void testGetPayloadStringForNull() { assertNull(new NotificationMessage().getPayloadString(ENTRY_NAME)); }
|
public String getPayloadString(String name) { return payload.get(name) == null ? null : String.valueOf(payload.get(name)); }
|
NotificationMessage implements Serializable { public String getPayloadString(String name) { return payload.get(name) == null ? null : String.valueOf(payload.get(name)); } }
|
NotificationMessage implements Serializable { public String getPayloadString(String name) { return payload.get(name) == null ? null : String.valueOf(payload.get(name)); } }
|
NotificationMessage implements Serializable { public String getPayloadString(String name) { return payload.get(name) == null ? null : String.valueOf(payload.get(name)); } static String buildSubjectPrefix(String nsPath); Map<String, Object> getPayload(); String getPayloadString(String name); void putPayloadEntry(String name, Object value); void putPayloadEntries(Map<String, Object> payloadEntries); String getNsPath(); void setNsPath(String nsPath); String getSource(); void setSource(String source); long getTimestamp(); void setTimestamp(long timestamp); long getCmsId(); void setCmsId(long cmsId); NotificationSeverity getSeverity(); void setSeverity(NotificationSeverity severity); NotificationType getType(); void setType(NotificationType type); String getSubject(); void setSubject(String subject); String getTemplateName(); void setTemplateName(String templateName); String getTemplateParams(); void setTemplateParams(String templateParams); String getText(); void setText(String text); String getEnvironmentProfileName(); void setEnvironmentProfileName(String envProfile); String getAdminStatus(); void setAdminStatus(String adminStatus); long getManifestCiId(); void setManifestCiId(long manifestCiId); String getCloudName(); void setCloudName(String cloudName); void appendText(String notes); String asString(); List<CmsCISimple> getCis(); void setCis(List<CmsCISimple> cis); }
|
NotificationMessage implements Serializable { public String getPayloadString(String name) { return payload.get(name) == null ? null : String.valueOf(payload.get(name)); } static String buildSubjectPrefix(String nsPath); Map<String, Object> getPayload(); String getPayloadString(String name); void putPayloadEntry(String name, Object value); void putPayloadEntries(Map<String, Object> payloadEntries); String getNsPath(); void setNsPath(String nsPath); String getSource(); void setSource(String source); long getTimestamp(); void setTimestamp(long timestamp); long getCmsId(); void setCmsId(long cmsId); NotificationSeverity getSeverity(); void setSeverity(NotificationSeverity severity); NotificationType getType(); void setType(NotificationType type); String getSubject(); void setSubject(String subject); String getTemplateName(); void setTemplateName(String templateName); String getTemplateParams(); void setTemplateParams(String templateParams); String getText(); void setText(String text); String getEnvironmentProfileName(); void setEnvironmentProfileName(String envProfile); String getAdminStatus(); void setAdminStatus(String adminStatus); long getManifestCiId(); void setManifestCiId(long manifestCiId); String getCloudName(); void setCloudName(String cloudName); void appendText(String notes); String asString(); List<CmsCISimple> getCis(); void setCis(List<CmsCISimple> cis); }
|
@Test(expectedExceptions = CmsException.class) public void badDESEnvTest() throws Exception { CmsCryptoDES crypto1 = new CmsCryptoDES(); try { crypto1.init(); } catch (FileNotFoundException e) { throw new CmsException(33, "File not found, likely a devbox, throwing CmsException"); } }
|
public void init() throws IOException, GeneralSecurityException { Security.addProvider(new BouncyCastleProvider()); this.secretKeyFile = System.getenv("CMS_DES_PEM"); if (this.secretKeyFile == null) { this.secretKeyFile = System.getProperty("com.kloopz.crypto.cms_des_pem"); } if (this.secretKeyFile == null) { logger.error(">>>>>>>>>>>>>>Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); throw new FileNotFoundException("Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); } initEncryptorDecryptor(); }
|
CmsCryptoDES implements CmsCrypto { public void init() throws IOException, GeneralSecurityException { Security.addProvider(new BouncyCastleProvider()); this.secretKeyFile = System.getenv("CMS_DES_PEM"); if (this.secretKeyFile == null) { this.secretKeyFile = System.getProperty("com.kloopz.crypto.cms_des_pem"); } if (this.secretKeyFile == null) { logger.error(">>>>>>>>>>>>>>Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); throw new FileNotFoundException("Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); } initEncryptorDecryptor(); } }
|
CmsCryptoDES implements CmsCrypto { public void init() throws IOException, GeneralSecurityException { Security.addProvider(new BouncyCastleProvider()); this.secretKeyFile = System.getenv("CMS_DES_PEM"); if (this.secretKeyFile == null) { this.secretKeyFile = System.getProperty("com.kloopz.crypto.cms_des_pem"); } if (this.secretKeyFile == null) { logger.error(">>>>>>>>>>>>>>Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); throw new FileNotFoundException("Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); } initEncryptorDecryptor(); } }
|
CmsCryptoDES implements CmsCrypto { public void init() throws IOException, GeneralSecurityException { Security.addProvider(new BouncyCastleProvider()); this.secretKeyFile = System.getenv("CMS_DES_PEM"); if (this.secretKeyFile == null) { this.secretKeyFile = System.getProperty("com.kloopz.crypto.cms_des_pem"); } if (this.secretKeyFile == null) { logger.error(">>>>>>>>>>>>>>Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); throw new FileNotFoundException("Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); } initEncryptorDecryptor(); } @Override String encrypt(String instr); @Override String decrypt(String instr); @Override String decryptVars(String instr); void init(); static void generateDESKey(String file); static void main(String[] args); void setSecretKeyFile(String secretKeyFile); void init(String secretKeyFile); }
|
CmsCryptoDES implements CmsCrypto { public void init() throws IOException, GeneralSecurityException { Security.addProvider(new BouncyCastleProvider()); this.secretKeyFile = System.getenv("CMS_DES_PEM"); if (this.secretKeyFile == null) { this.secretKeyFile = System.getProperty("com.kloopz.crypto.cms_des_pem"); } if (this.secretKeyFile == null) { logger.error(">>>>>>>>>>>>>>Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); throw new FileNotFoundException("Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); } initEncryptorDecryptor(); } @Override String encrypt(String instr); @Override String decrypt(String instr); @Override String decryptVars(String instr); void init(); static void generateDESKey(String file); static void main(String[] args); void setSecretKeyFile(String secretKeyFile); void init(String secretKeyFile); }
|
@Test(expectedExceptions = IOException.class) public void badFileTest() throws Exception { CmsCryptoDES crypto1 = new CmsCryptoDES(); crypto1.init("this-is-not-a-key-file"); }
|
public void init() throws IOException, GeneralSecurityException { Security.addProvider(new BouncyCastleProvider()); this.secretKeyFile = System.getenv("CMS_DES_PEM"); if (this.secretKeyFile == null) { this.secretKeyFile = System.getProperty("com.kloopz.crypto.cms_des_pem"); } if (this.secretKeyFile == null) { logger.error(">>>>>>>>>>>>>>Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); throw new FileNotFoundException("Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); } initEncryptorDecryptor(); }
|
CmsCryptoDES implements CmsCrypto { public void init() throws IOException, GeneralSecurityException { Security.addProvider(new BouncyCastleProvider()); this.secretKeyFile = System.getenv("CMS_DES_PEM"); if (this.secretKeyFile == null) { this.secretKeyFile = System.getProperty("com.kloopz.crypto.cms_des_pem"); } if (this.secretKeyFile == null) { logger.error(">>>>>>>>>>>>>>Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); throw new FileNotFoundException("Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); } initEncryptorDecryptor(); } }
|
CmsCryptoDES implements CmsCrypto { public void init() throws IOException, GeneralSecurityException { Security.addProvider(new BouncyCastleProvider()); this.secretKeyFile = System.getenv("CMS_DES_PEM"); if (this.secretKeyFile == null) { this.secretKeyFile = System.getProperty("com.kloopz.crypto.cms_des_pem"); } if (this.secretKeyFile == null) { logger.error(">>>>>>>>>>>>>>Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); throw new FileNotFoundException("Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); } initEncryptorDecryptor(); } }
|
CmsCryptoDES implements CmsCrypto { public void init() throws IOException, GeneralSecurityException { Security.addProvider(new BouncyCastleProvider()); this.secretKeyFile = System.getenv("CMS_DES_PEM"); if (this.secretKeyFile == null) { this.secretKeyFile = System.getProperty("com.kloopz.crypto.cms_des_pem"); } if (this.secretKeyFile == null) { logger.error(">>>>>>>>>>>>>>Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); throw new FileNotFoundException("Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); } initEncryptorDecryptor(); } @Override String encrypt(String instr); @Override String decrypt(String instr); @Override String decryptVars(String instr); void init(); static void generateDESKey(String file); static void main(String[] args); void setSecretKeyFile(String secretKeyFile); void init(String secretKeyFile); }
|
CmsCryptoDES implements CmsCrypto { public void init() throws IOException, GeneralSecurityException { Security.addProvider(new BouncyCastleProvider()); this.secretKeyFile = System.getenv("CMS_DES_PEM"); if (this.secretKeyFile == null) { this.secretKeyFile = System.getProperty("com.kloopz.crypto.cms_des_pem"); } if (this.secretKeyFile == null) { logger.error(">>>>>>>>>>>>>>Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); throw new FileNotFoundException("Failed to init DES Encryptor/Decryptor no key faile is set, use CMS_DES_PEM env var to set location!"); } initEncryptorDecryptor(); } @Override String encrypt(String instr); @Override String decrypt(String instr); @Override String decryptVars(String instr); void init(); static void generateDESKey(String file); static void main(String[] args); void setSecretKeyFile(String secretKeyFile); void init(String secretKeyFile); }
|
@Test(threadPoolSize = 10, invocationCount = 3, timeOut = 10000) public void testDecrypt() throws Exception { String decryptedUUID = crypto.decrypt(encryptedString); Assert.assertTrue(rawString.equals(decryptedUUID)); }
|
@Override public String decrypt(String instr) throws GeneralSecurityException { if (instr.startsWith(ENC_PREFIX)) { instr = instr.substring(ENC_PREFIX.length()); } return decryptStr(instr); }
|
CmsCryptoDES implements CmsCrypto { @Override public String decrypt(String instr) throws GeneralSecurityException { if (instr.startsWith(ENC_PREFIX)) { instr = instr.substring(ENC_PREFIX.length()); } return decryptStr(instr); } }
|
CmsCryptoDES implements CmsCrypto { @Override public String decrypt(String instr) throws GeneralSecurityException { if (instr.startsWith(ENC_PREFIX)) { instr = instr.substring(ENC_PREFIX.length()); } return decryptStr(instr); } }
|
CmsCryptoDES implements CmsCrypto { @Override public String decrypt(String instr) throws GeneralSecurityException { if (instr.startsWith(ENC_PREFIX)) { instr = instr.substring(ENC_PREFIX.length()); } return decryptStr(instr); } @Override String encrypt(String instr); @Override String decrypt(String instr); @Override String decryptVars(String instr); void init(); static void generateDESKey(String file); static void main(String[] args); void setSecretKeyFile(String secretKeyFile); void init(String secretKeyFile); }
|
CmsCryptoDES implements CmsCrypto { @Override public String decrypt(String instr) throws GeneralSecurityException { if (instr.startsWith(ENC_PREFIX)) { instr = instr.substring(ENC_PREFIX.length()); } return decryptStr(instr); } @Override String encrypt(String instr); @Override String decrypt(String instr); @Override String decryptVars(String instr); void init(); static void generateDESKey(String file); static void main(String[] args); void setSecretKeyFile(String secretKeyFile); void init(String secretKeyFile); }
|
@Test public void testEmptyString() throws Exception { String decryptedText = crypto.decrypt(CmsCrypto.ENC_PREFIX); Assert.assertTrue(StringUtils.EMPTY.equals(decryptedText)); }
|
@Override public String decrypt(String instr) throws GeneralSecurityException { if (instr.startsWith(ENC_PREFIX)) { instr = instr.substring(ENC_PREFIX.length()); } return decryptStr(instr); }
|
CmsCryptoDES implements CmsCrypto { @Override public String decrypt(String instr) throws GeneralSecurityException { if (instr.startsWith(ENC_PREFIX)) { instr = instr.substring(ENC_PREFIX.length()); } return decryptStr(instr); } }
|
CmsCryptoDES implements CmsCrypto { @Override public String decrypt(String instr) throws GeneralSecurityException { if (instr.startsWith(ENC_PREFIX)) { instr = instr.substring(ENC_PREFIX.length()); } return decryptStr(instr); } }
|
CmsCryptoDES implements CmsCrypto { @Override public String decrypt(String instr) throws GeneralSecurityException { if (instr.startsWith(ENC_PREFIX)) { instr = instr.substring(ENC_PREFIX.length()); } return decryptStr(instr); } @Override String encrypt(String instr); @Override String decrypt(String instr); @Override String decryptVars(String instr); void init(); static void generateDESKey(String file); static void main(String[] args); void setSecretKeyFile(String secretKeyFile); void init(String secretKeyFile); }
|
CmsCryptoDES implements CmsCrypto { @Override public String decrypt(String instr) throws GeneralSecurityException { if (instr.startsWith(ENC_PREFIX)) { instr = instr.substring(ENC_PREFIX.length()); } return decryptStr(instr); } @Override String encrypt(String instr); @Override String decrypt(String instr); @Override String decryptVars(String instr); void init(); static void generateDESKey(String file); static void main(String[] args); void setSecretKeyFile(String secretKeyFile); void init(String secretKeyFile); }
|
@Test public void testList1() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { List<MyBean> listOfBeans = new ArrayList<MyBean>(LIST_SIZE); for (int i = 1; i <= LIST_SIZE; i++) { MyBean m = new MyBean(String.valueOf(i)); listOfBeans.add(m); } Map<String, MyBean> outMap = util.toMap(listOfBeans, KEY_FIELD); assertEquals(LIST_SIZE, outMap.size()); for(MyBean listMember : listOfBeans){ assertEquals(listMember, outMap.get(listMember.getSpecialValue())); } System.out.println(outMap); }
|
public <V> Map<K, V> toMap(List<V> list, String keyField) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { String accessor = convertFieldToAccessor(keyField); Map<K, V> map = new HashMap<K, V>(); for(V obj : list) { Method method = obj.getClass().getMethod(accessor); @SuppressWarnings("unchecked") K key = (K)method.invoke(obj); map.put(key, obj); } return map; }
|
ListUtils { public <V> Map<K, V> toMap(List<V> list, String keyField) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { String accessor = convertFieldToAccessor(keyField); Map<K, V> map = new HashMap<K, V>(); for(V obj : list) { Method method = obj.getClass().getMethod(accessor); @SuppressWarnings("unchecked") K key = (K)method.invoke(obj); map.put(key, obj); } return map; } }
|
ListUtils { public <V> Map<K, V> toMap(List<V> list, String keyField) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { String accessor = convertFieldToAccessor(keyField); Map<K, V> map = new HashMap<K, V>(); for(V obj : list) { Method method = obj.getClass().getMethod(accessor); @SuppressWarnings("unchecked") K key = (K)method.invoke(obj); map.put(key, obj); } return map; } }
|
ListUtils { public <V> Map<K, V> toMap(List<V> list, String keyField) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { String accessor = convertFieldToAccessor(keyField); Map<K, V> map = new HashMap<K, V>(); for(V obj : list) { Method method = obj.getClass().getMethod(accessor); @SuppressWarnings("unchecked") K key = (K)method.invoke(obj); map.put(key, obj); } return map; } Map<K, V> toMap(List<V> list, String keyField); Map<K, List<V>> toMapOfList(List<V> list, String keyField); }
|
ListUtils { public <V> Map<K, V> toMap(List<V> list, String keyField) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { String accessor = convertFieldToAccessor(keyField); Map<K, V> map = new HashMap<K, V>(); for(V obj : list) { Method method = obj.getClass().getMethod(accessor); @SuppressWarnings("unchecked") K key = (K)method.invoke(obj); map.put(key, obj); } return map; } Map<K, V> toMap(List<V> list, String keyField); Map<K, List<V>> toMapOfList(List<V> list, String keyField); }
|
@Test public void testEventClosed(){ OpsCloseEvent opsCloseEvent = new OpsCloseEvent(); opsCloseEvent.setBucket(BUCKET); opsCloseEvent.setCiId(CI_ID); opsCloseEvent.setCiState(CI_STATE); opsCloseEvent.setManifestId(CI_MANIFEST_ID); opsCloseEvent.setSource(CI_SOURCE); opsCloseEvent.setType(CI_TYPE); opsCloseEvent.setTimestamp(CI_TIMESTAMP); PerfEventPayload metrics = new PerfEventPayload(); Map<String, Double> countMap = new HashMap<String, Double>(1); countMap.put(P_KEY, P_VAL); metrics.setCount(countMap); opsCloseEvent.setMetrics(metrics); OpsBaseEvent convertedOut = EventConverter.convert(opsCloseEvent); assertEquals(convertedOut.getBucket(),BUCKET); assertEquals(convertedOut.getCiState(),CI_STATE); assertEquals(convertedOut.getSource(),CI_SOURCE); assertEquals(convertedOut.getType(),CI_TYPE); assertEquals(convertedOut.getMetrics(),metrics); assert(CI_TIMESTAMP.equals(convertedOut.getTimestamp())); assert(CI_MANIFEST_ID.equals(convertedOut.getManifestId())); assert(CI_ID.equals(convertedOut.getCiId() )); }
|
public static OpsBaseEvent convert(OpsEvent oEvent) { OpsBaseEvent bEvent = new OpsBaseEvent(); bEvent.setCiId(oEvent.getCiId()); bEvent.setBucket(oEvent.getBucket()); bEvent.setCiState(oEvent.getCiState()); bEvent.setName(oEvent.getName()); bEvent.setManifestId(oEvent.getManifestId()); bEvent.setSource(oEvent.getSource()); bEvent.setState(oEvent.getState()); bEvent.setType(oEvent.getType()); bEvent.setMetrics(oEvent.getMetrics()); bEvent.setTimestamp(oEvent.getTimestamp()); bEvent.setCount(oEvent.getCount()); bEvent.setStatus(oEvent.getStatus()); bEvent.setCoolOff(oEvent.getCoolOff()); return bEvent; }
|
EventConverter { public static OpsBaseEvent convert(OpsEvent oEvent) { OpsBaseEvent bEvent = new OpsBaseEvent(); bEvent.setCiId(oEvent.getCiId()); bEvent.setBucket(oEvent.getBucket()); bEvent.setCiState(oEvent.getCiState()); bEvent.setName(oEvent.getName()); bEvent.setManifestId(oEvent.getManifestId()); bEvent.setSource(oEvent.getSource()); bEvent.setState(oEvent.getState()); bEvent.setType(oEvent.getType()); bEvent.setMetrics(oEvent.getMetrics()); bEvent.setTimestamp(oEvent.getTimestamp()); bEvent.setCount(oEvent.getCount()); bEvent.setStatus(oEvent.getStatus()); bEvent.setCoolOff(oEvent.getCoolOff()); return bEvent; } }
|
EventConverter { public static OpsBaseEvent convert(OpsEvent oEvent) { OpsBaseEvent bEvent = new OpsBaseEvent(); bEvent.setCiId(oEvent.getCiId()); bEvent.setBucket(oEvent.getBucket()); bEvent.setCiState(oEvent.getCiState()); bEvent.setName(oEvent.getName()); bEvent.setManifestId(oEvent.getManifestId()); bEvent.setSource(oEvent.getSource()); bEvent.setState(oEvent.getState()); bEvent.setType(oEvent.getType()); bEvent.setMetrics(oEvent.getMetrics()); bEvent.setTimestamp(oEvent.getTimestamp()); bEvent.setCount(oEvent.getCount()); bEvent.setStatus(oEvent.getStatus()); bEvent.setCoolOff(oEvent.getCoolOff()); return bEvent; } }
|
EventConverter { public static OpsBaseEvent convert(OpsEvent oEvent) { OpsBaseEvent bEvent = new OpsBaseEvent(); bEvent.setCiId(oEvent.getCiId()); bEvent.setBucket(oEvent.getBucket()); bEvent.setCiState(oEvent.getCiState()); bEvent.setName(oEvent.getName()); bEvent.setManifestId(oEvent.getManifestId()); bEvent.setSource(oEvent.getSource()); bEvent.setState(oEvent.getState()); bEvent.setType(oEvent.getType()); bEvent.setMetrics(oEvent.getMetrics()); bEvent.setTimestamp(oEvent.getTimestamp()); bEvent.setCount(oEvent.getCount()); bEvent.setStatus(oEvent.getStatus()); bEvent.setCoolOff(oEvent.getCoolOff()); return bEvent; } static OpsBaseEvent convert(OpsEvent oEvent); static OpsBaseEvent convert(OpsCloseEvent oEvent); }
|
EventConverter { public static OpsBaseEvent convert(OpsEvent oEvent) { OpsBaseEvent bEvent = new OpsBaseEvent(); bEvent.setCiId(oEvent.getCiId()); bEvent.setBucket(oEvent.getBucket()); bEvent.setCiState(oEvent.getCiState()); bEvent.setName(oEvent.getName()); bEvent.setManifestId(oEvent.getManifestId()); bEvent.setSource(oEvent.getSource()); bEvent.setState(oEvent.getState()); bEvent.setType(oEvent.getType()); bEvent.setMetrics(oEvent.getMetrics()); bEvent.setTimestamp(oEvent.getTimestamp()); bEvent.setCount(oEvent.getCount()); bEvent.setStatus(oEvent.getStatus()); bEvent.setCoolOff(oEvent.getCoolOff()); return bEvent; } static OpsBaseEvent convert(OpsEvent oEvent); static OpsBaseEvent convert(OpsCloseEvent oEvent); }
|
@Test public void testEmptyName(){ CmsRfcCI rfcCi = new CmsRfcCI(); rfcCi.setCiName(""); CIValidationResult result = this.validator.validateRfcCi(rfcCi); assertTrue(result.getErrorMsg().startsWith("CI Name can not be empty!"),"unex:"+result.getErrorMsg()); assertEquals(result.isValidated(),false); }
|
public CIValidationResult validateRfcCi(CmsRfcCI rfcCi) { CIValidationResult result = new CIValidationResult(); result.setValidated(true); if (rfcCi.getCiName() == null || rfcCi.getCiName().length()==0) { result.setValidated(false); result.setErrorMsg("CI Name can not be empty!"); return result; } CmsClazz clazz = getClazz(rfcCi.getCiClassName()); if (clazz == null) { result.setValidated(false); result.setErrorMsg("There is no class definition for " + rfcCi.getCiClassName()); return result; } rfcCi.setCiClassId(clazz.getClassId()); if (rfcCi.getNsId() == 0) { CmsNamespace ns = getNs(rfcCi.getNsPath()); if (ns == null) { result.setValidated(false); result.setErrorMsg("The namespace must be specified"); return result; } rfcCi.setNsId(ns.getNsId()); } Map<String, CmsClazzAttribute> clazzAttrsMap = new HashMap<String, CmsClazzAttribute>(); for (CmsClazzAttribute clazzAttr : clazz.getMdAttributes()) { clazzAttrsMap.put(clazzAttr.getAttributeName(), clazzAttr); } if ("add".equalsIgnoreCase(rfcCi.getRfcAction())) { for (CmsClazzAttribute clazzAttr : clazz.getMdAttributes()) { if (clazzAttr.getIsMandatory() && (rfcCi.getAttribute(clazzAttr.getAttributeName()) == null)) { result.setValidated(false); result.addErrorMsg("Attribute " + clazzAttr.getAttributeName() + " is required for ci type of " + clazz.getClassName()); } } } for (CmsRfcAttribute attr : rfcCi.getAttributes().values()) { if (!clazzAttrsMap.containsKey(attr.getAttributeName())) { result.setValidated(false); result.addErrorMsg("Attribute " + attr.getAttributeName() + " is not defined in class " + clazz.getClassName()); } else { attr.setAttributeId(clazzAttrsMap.get(attr.getAttributeName()).getAttributeId()); } } if (!result.isValidated()) return result; encryptRfcAttrs(clazzAttrsMap, rfcCi, result); return result; }
|
CmsDJValidator { public CIValidationResult validateRfcCi(CmsRfcCI rfcCi) { CIValidationResult result = new CIValidationResult(); result.setValidated(true); if (rfcCi.getCiName() == null || rfcCi.getCiName().length()==0) { result.setValidated(false); result.setErrorMsg("CI Name can not be empty!"); return result; } CmsClazz clazz = getClazz(rfcCi.getCiClassName()); if (clazz == null) { result.setValidated(false); result.setErrorMsg("There is no class definition for " + rfcCi.getCiClassName()); return result; } rfcCi.setCiClassId(clazz.getClassId()); if (rfcCi.getNsId() == 0) { CmsNamespace ns = getNs(rfcCi.getNsPath()); if (ns == null) { result.setValidated(false); result.setErrorMsg("The namespace must be specified"); return result; } rfcCi.setNsId(ns.getNsId()); } Map<String, CmsClazzAttribute> clazzAttrsMap = new HashMap<String, CmsClazzAttribute>(); for (CmsClazzAttribute clazzAttr : clazz.getMdAttributes()) { clazzAttrsMap.put(clazzAttr.getAttributeName(), clazzAttr); } if ("add".equalsIgnoreCase(rfcCi.getRfcAction())) { for (CmsClazzAttribute clazzAttr : clazz.getMdAttributes()) { if (clazzAttr.getIsMandatory() && (rfcCi.getAttribute(clazzAttr.getAttributeName()) == null)) { result.setValidated(false); result.addErrorMsg("Attribute " + clazzAttr.getAttributeName() + " is required for ci type of " + clazz.getClassName()); } } } for (CmsRfcAttribute attr : rfcCi.getAttributes().values()) { if (!clazzAttrsMap.containsKey(attr.getAttributeName())) { result.setValidated(false); result.addErrorMsg("Attribute " + attr.getAttributeName() + " is not defined in class " + clazz.getClassName()); } else { attr.setAttributeId(clazzAttrsMap.get(attr.getAttributeName()).getAttributeId()); } } if (!result.isValidated()) return result; encryptRfcAttrs(clazzAttrsMap, rfcCi, result); return result; } }
|
CmsDJValidator { public CIValidationResult validateRfcCi(CmsRfcCI rfcCi) { CIValidationResult result = new CIValidationResult(); result.setValidated(true); if (rfcCi.getCiName() == null || rfcCi.getCiName().length()==0) { result.setValidated(false); result.setErrorMsg("CI Name can not be empty!"); return result; } CmsClazz clazz = getClazz(rfcCi.getCiClassName()); if (clazz == null) { result.setValidated(false); result.setErrorMsg("There is no class definition for " + rfcCi.getCiClassName()); return result; } rfcCi.setCiClassId(clazz.getClassId()); if (rfcCi.getNsId() == 0) { CmsNamespace ns = getNs(rfcCi.getNsPath()); if (ns == null) { result.setValidated(false); result.setErrorMsg("The namespace must be specified"); return result; } rfcCi.setNsId(ns.getNsId()); } Map<String, CmsClazzAttribute> clazzAttrsMap = new HashMap<String, CmsClazzAttribute>(); for (CmsClazzAttribute clazzAttr : clazz.getMdAttributes()) { clazzAttrsMap.put(clazzAttr.getAttributeName(), clazzAttr); } if ("add".equalsIgnoreCase(rfcCi.getRfcAction())) { for (CmsClazzAttribute clazzAttr : clazz.getMdAttributes()) { if (clazzAttr.getIsMandatory() && (rfcCi.getAttribute(clazzAttr.getAttributeName()) == null)) { result.setValidated(false); result.addErrorMsg("Attribute " + clazzAttr.getAttributeName() + " is required for ci type of " + clazz.getClassName()); } } } for (CmsRfcAttribute attr : rfcCi.getAttributes().values()) { if (!clazzAttrsMap.containsKey(attr.getAttributeName())) { result.setValidated(false); result.addErrorMsg("Attribute " + attr.getAttributeName() + " is not defined in class " + clazz.getClassName()); } else { attr.setAttributeId(clazzAttrsMap.get(attr.getAttributeName()).getAttributeId()); } } if (!result.isValidated()) return result; encryptRfcAttrs(clazzAttrsMap, rfcCi, result); return result; } }
|
CmsDJValidator { public CIValidationResult validateRfcCi(CmsRfcCI rfcCi) { CIValidationResult result = new CIValidationResult(); result.setValidated(true); if (rfcCi.getCiName() == null || rfcCi.getCiName().length()==0) { result.setValidated(false); result.setErrorMsg("CI Name can not be empty!"); return result; } CmsClazz clazz = getClazz(rfcCi.getCiClassName()); if (clazz == null) { result.setValidated(false); result.setErrorMsg("There is no class definition for " + rfcCi.getCiClassName()); return result; } rfcCi.setCiClassId(clazz.getClassId()); if (rfcCi.getNsId() == 0) { CmsNamespace ns = getNs(rfcCi.getNsPath()); if (ns == null) { result.setValidated(false); result.setErrorMsg("The namespace must be specified"); return result; } rfcCi.setNsId(ns.getNsId()); } Map<String, CmsClazzAttribute> clazzAttrsMap = new HashMap<String, CmsClazzAttribute>(); for (CmsClazzAttribute clazzAttr : clazz.getMdAttributes()) { clazzAttrsMap.put(clazzAttr.getAttributeName(), clazzAttr); } if ("add".equalsIgnoreCase(rfcCi.getRfcAction())) { for (CmsClazzAttribute clazzAttr : clazz.getMdAttributes()) { if (clazzAttr.getIsMandatory() && (rfcCi.getAttribute(clazzAttr.getAttributeName()) == null)) { result.setValidated(false); result.addErrorMsg("Attribute " + clazzAttr.getAttributeName() + " is required for ci type of " + clazz.getClassName()); } } } for (CmsRfcAttribute attr : rfcCi.getAttributes().values()) { if (!clazzAttrsMap.containsKey(attr.getAttributeName())) { result.setValidated(false); result.addErrorMsg("Attribute " + attr.getAttributeName() + " is not defined in class " + clazz.getClassName()); } else { attr.setAttributeId(clazzAttrsMap.get(attr.getAttributeName()).getAttributeId()); } } if (!result.isValidated()) return result; encryptRfcAttrs(clazzAttrsMap, rfcCi, result); return result; } void setCmsMdProcessor(CmsMdProcessor cmsMdProcessor); void setCmsNsProcessor(CmsNsProcessor cmsNsProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); CIValidationResult validateRfcCi(CmsRfcCI rfcCi); CIValidationResult validateRfcCiAttrs(CmsRfcCI rfcCi); CIValidationResult validateRfcRelation(CmsRfcRelation rfcRelation, int fromClassId, int toClassId); CIValidationResult validateRfcRelationAttrs(CmsRfcRelation rfcRelation); boolean rfcCisEqual(CmsRfcCI ci1, CmsRfcCI ci2); boolean rfcAttrsEqual(CmsRfcAttribute attr1, CmsRfcAttribute attr2); boolean equalStrs(String str1, String str2); }
|
CmsDJValidator { public CIValidationResult validateRfcCi(CmsRfcCI rfcCi) { CIValidationResult result = new CIValidationResult(); result.setValidated(true); if (rfcCi.getCiName() == null || rfcCi.getCiName().length()==0) { result.setValidated(false); result.setErrorMsg("CI Name can not be empty!"); return result; } CmsClazz clazz = getClazz(rfcCi.getCiClassName()); if (clazz == null) { result.setValidated(false); result.setErrorMsg("There is no class definition for " + rfcCi.getCiClassName()); return result; } rfcCi.setCiClassId(clazz.getClassId()); if (rfcCi.getNsId() == 0) { CmsNamespace ns = getNs(rfcCi.getNsPath()); if (ns == null) { result.setValidated(false); result.setErrorMsg("The namespace must be specified"); return result; } rfcCi.setNsId(ns.getNsId()); } Map<String, CmsClazzAttribute> clazzAttrsMap = new HashMap<String, CmsClazzAttribute>(); for (CmsClazzAttribute clazzAttr : clazz.getMdAttributes()) { clazzAttrsMap.put(clazzAttr.getAttributeName(), clazzAttr); } if ("add".equalsIgnoreCase(rfcCi.getRfcAction())) { for (CmsClazzAttribute clazzAttr : clazz.getMdAttributes()) { if (clazzAttr.getIsMandatory() && (rfcCi.getAttribute(clazzAttr.getAttributeName()) == null)) { result.setValidated(false); result.addErrorMsg("Attribute " + clazzAttr.getAttributeName() + " is required for ci type of " + clazz.getClassName()); } } } for (CmsRfcAttribute attr : rfcCi.getAttributes().values()) { if (!clazzAttrsMap.containsKey(attr.getAttributeName())) { result.setValidated(false); result.addErrorMsg("Attribute " + attr.getAttributeName() + " is not defined in class " + clazz.getClassName()); } else { attr.setAttributeId(clazzAttrsMap.get(attr.getAttributeName()).getAttributeId()); } } if (!result.isValidated()) return result; encryptRfcAttrs(clazzAttrsMap, rfcCi, result); return result; } void setCmsMdProcessor(CmsMdProcessor cmsMdProcessor); void setCmsNsProcessor(CmsNsProcessor cmsNsProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); CIValidationResult validateRfcCi(CmsRfcCI rfcCi); CIValidationResult validateRfcCiAttrs(CmsRfcCI rfcCi); CIValidationResult validateRfcRelation(CmsRfcRelation rfcRelation, int fromClassId, int toClassId); CIValidationResult validateRfcRelationAttrs(CmsRfcRelation rfcRelation); boolean rfcCisEqual(CmsRfcCI ci1, CmsRfcCI ci2); boolean rfcAttrsEqual(CmsRfcAttribute attr1, CmsRfcAttribute attr2); boolean equalStrs(String str1, String str2); }
|
@Test public void processAllVarsTest() { String[] cloudValues = new String[]{"cbar", "cfoo", "cbaz"}; String[] globalValues = new String[]{"gbat", "gfee", "gbiz"}; String[] localValues = new String[]{"lbaz", "lfuu", "lbuz"}; Map<String, String> cloudVars = getVariablesMap(cloudValues); logger.info("cloud values have been set too: " + cloudVars); Map<String, String> globalVars = getVariablesMap(globalValues); logger.info("globalVars values have been set too: " + globalVars); Map<String, String> localVars = getVariablesMap(localValues); logger.info("local values have been set too: " + localVars); CmsCI ci = new CmsCI(); ci.setCiId(4444); ci.setCiName("processAllVarsTest"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(cloudValues.length * 3); int i = 0; for (String cloudVariable : cloudValues) { CmsCIAttribute attrC = new CmsCIAttribute(); attrC.setDjValue("$OO_CLOUD{" + cloudVariable + "}"); attrC.setAttributeName("pav1"); attributes.put("cloud_" + (++i), attrC); } for (String globalVariable : globalValues) { CmsCIAttribute attrH = new CmsCIAttribute(); attrH.setDjValue("$OO_GLOBAL{" + globalVariable + "}"); attrH.setAttributeName("pav2"); attributes.put("global_" + (++i), attrH); } for (String localVariable : localValues) { CmsCIAttribute attrI = new CmsCIAttribute(); attrI.setDjValue("$OO_LOCAL{" + localVariable + "}"); attrI.setAttributeName("pav3"); attributes.put("local_" + (++i), attrI); } ci.setAttributes(attributes); logger.info("CI Attributes have been set into the ci, attrs: " + attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("after>" + djKey + "->" + djAfter); if (djKey.startsWith("cloud_")) { String expected = attributesBefore.get(djKey).getDjValue().replace("OO_CLOUD{", "") .replace("}", "").toUpperCase(); assertEquals(djAfter, expected, "did not measure up for key " + djKey); } else { if (djKey.startsWith("global_")) { String expected = attributesBefore.get(djKey).getDjValue().replace("OO_GLOBAL{", "") .replace("}", "").toUpperCase(); assertEquals(djAfter, expected, "did not measure up for key " + djKey); } else { if (djKey.startsWith("local_")) { String expected = attributesBefore.get(djKey).getDjValue().replace("OO_LOCAL{", "") .replace("}", "").toUpperCase(); assertEquals(djAfter, expected, "did not measure up for key " + djKey); } } } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void processGlobalValueWithCloudValueResolution() { String[] cloudValues = new String[]{"czat", "czitCCC"}; String[] globalValues = new String[]{"czit"}; Map<String, String> cloudVars = getVariablesMap(cloudValues); logger.info("cloud values have been set too: " + cloudVars); Map<String, String> globalVars = new HashMap<>(3); for (String val : globalValues) { globalVars.put(val, "$OO_CLOUD{" + val + "CCC}" ); } logger.info("globalVars values have been set too: " + globalVars); CmsCI ci = new CmsCI(); ci.setCiId(9876); ci.setCiName("processGlobalValueWithCloudValueResolution"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(cloudValues.length * 3); int i = 0; for (String cloudVariable : cloudValues) { CmsCIAttribute attrC = new CmsCIAttribute(); attrC.setDjValue("$OO_CLOUD{" + cloudVariable + "}"); attributes.put("cloud_" + (++i), attrC); } for (String globalVariable : globalValues) { CmsCIAttribute attrG = new CmsCIAttribute(); attrG.setDjValue("$OO_GLOBAL{" + globalVariable + "}"); attrG.setAttributeName("djdj"); attributes.put("global_" + (++i), attrG); } ci.setAttributes(attributes); logger.info("CI Attributes have been set into the ci, attrs: " + attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, globalVars, null); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, globalVars, new HashMap<>()); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("after>" + djKey + "->" + djAfter); if (djKey.startsWith("cloud_")) { String expected = attributesBefore.get(djKey).getDjValue().replace("OO_CLOUD{", "") .replace("}", "").toUpperCase(); assertEquals(djAfter, expected, "did not measure up for key " + djKey); } else { if (djKey.startsWith("global_")) { String expected = attributesBefore.get(djKey).getDjValue().replace("OO_GLOBAL{", "") .replace("}", "").toUpperCase(); assertEquals(djAfter, expected, "did not measure up for key " + djKey); } } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void processLocalValueWithGlobalValueResolution() { String[] globalValues = new String[]{"ggyp-Global"}; Map<String, String> globalVars = getVariablesMap(globalValues); System.out.println("globalVars values have been set to : " + globalVars); Map<String, String> localVars = new LinkedHashMap<>(2); localVars.put("myLocalScalar", "abcdefg"); localVars.put("myLocalVariable", "$OO_GLOBAL{ggyp-Global}" ); System.out.println("localVars values have been set too: " + localVars); CmsCI ci = new CmsCI(); ci.setCiId(135791113); ci.setCiName("processLocalValueWithGlobalValueResolution"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); int i = 0; CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("$OO_LOCAL{myLocalVariable}"); attrL.setAttributeName("pl11"); attributes.put("l81_" + (++i), attrL); CmsCIAttribute attrL2 = new CmsCIAttribute(); attrL2.setDjValue("$OO_LOCAL{myLocalScalar}"); attrL2.setAttributeName("pl22"); attributes.put("l82_" + (++i), attrL2); ci.setAttributes(attributes); System.out .println("*****CI Attributes have been set into the ci, attrs: " + attributes.values()); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, new HashMap<>(), globalVars, localVars); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("after>" + djKey + "->" + djAfter); if (djKey.startsWith("global_")) { String expected = attributesBefore.get(djKey).getDjValue() .replace("OO_GLOBAL{", "").replace("}", "") .toUpperCase(); assertEquals(djAfter, expected, "did not measure up for key " + djKey); } else { if (djKey.startsWith("local_")) { String expected = attributesBefore.get(djKey).getDjValue() .replace("OO_LOCAL{", "").replace("}", "") .toUpperCase(); assertEquals(djAfter, expected, "did not measure up for key " + djKey); } } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 89) public void processLocalValueWithGlobalAndCloudValueResolution() { Map<String, String> cloudVars = new HashMap<>(3); cloudVars.put("justX", "ca"); cloudVars.put("p2", "cb"); Map<String, String> globalVars = new HashMap<>(3); globalVars.put("justX", "ga"); globalVars.put("p2", "$OO_CLOUD{p2}"); Map<String, String> localVars = new HashMap<>(3); localVars.put("l1", "$OO_GLOBAL{p2}"); localVars.put("p2", "$OO_GLOBAL{justX}"); CmsCI ci = new CmsCI(); ci.setCiId(89); ci.setCiName("processLocalValueWithGlobalAndCloudValueResolution"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("$OO_LOCAL{l1}"); attrL.setAttributeName("fo"); attributes.put("firstOne", attrL); CmsCIAttribute attrL2 = new CmsCIAttribute(); attrL2.setDjValue("$OO_LOCAL{p2}"); attrL2.setAttributeName("SO"); attributes.put("secondOne", attrL2); CmsCIAttribute attrL3 = new CmsCIAttribute(); attrL3.setDjValue("$OO_GLOBAL{p2}"); attrL3.setAttributeName("TO"); attributes.put("thirdOne", attrL3); ci.setAttributes(attributes); System.out .println("*****CI Attributes have been set into the ci, attrs: " + attributes.values()); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals("firstOne")) { assertEquals(djAfter, "cb", "firstOne was not resolved correctly, local>global>cloud"); } if (djKey.equals("secondOne")) { assertEquals(djAfter, "ga", "secondOne was not resolved correctly, local>global"); } if (djKey.equals("thirdOne")) { assertEquals(djAfter, "cb", "thirdOne was not resolved correctly, global>cloud"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 90) public void processLocalVarChoiceGlobalVsCloud() { Map<String, String> cloudVars = new HashMap<>(3); cloudVars.put("common", "duolc"); Map<String, String> globalVars = new HashMap<>(3); globalVars.put("common", "labolg"); Map<String, String> localVars = new HashMap<>(3); localVars.put("common", "lacol"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("processLocalVarChoiceGlobalVsCloud"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); int i = 0; CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("$OO_CLOUD{common}"); String nameOfAttribute = "my-one-attr"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals(nameOfAttribute)) { assertEquals(djAfter, "duolc"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 95) public void processLocalVarMid() { Map<String, String> localVars = new HashMap<>(3); localVars.put("mylocal", "123456"); CmsCI ci = new CmsCI(); ci.setCiId(95); ci.setCiName("processLocalVarMid"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); int i = 0; CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("/preamble/$OO_LOCAL{mylocal}"); String nameOfAttribute = "my-only-attr"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, null, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, null, null, localVars); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals(nameOfAttribute)) { assertEquals(djAfter, "/preamble/123456"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 98) public void processLocalVarDuo() { Map<String, String> localVars = new HashMap<>(3); localVars.put("mylocal", "123456"); CmsCI ci = new CmsCI(); ci.setCiId(98); ci.setCiName("processLocalVarDuo"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); int i = 0; CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("/preamble/$OO_LOCAL{mylocal}/middle/$OO_LOCAL{mylocal}"); String nameOfAttribute = "my-only-attr"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, null, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, null, null, localVars); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals(nameOfAttribute)) { assertEquals(djAfter, "/preamble/123456/middle/123456"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 105) public void processLocalVarUsingBothCloudGlobal() { Map<String, String> cloudVars = new HashMap<>(3); cloudVars.put("common", "cl1"); cloudVars.put("store", "st1"); Map<String, String> globalVars = new HashMap<>(3); globalVars.put("common", "gl1"); globalVars.put("version", "1.0"); globalVars.put("cldstr", "$OO_CLOUD{store}"); globalVars.put("dir", "up"); Map<String, String> localVars = new HashMap<>(3); localVars.put("common", "lc1-$OO_GLOBAL{common}-ver-$OO_CLOUD{common}-1-$OO_CLOUD{store}-v1-$OO_CLOUD{common}-$OO_GLOBAL{version}.SNAPSHOT"); localVars.put("store-name", "commons-$OO_GLOBAL{cldstr}-$OO_CLOUD{common}-$OO_GLOBAL{dir}"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("processLocalVarUsingBothCloudGlobal"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attr1 = new CmsCIAttribute(); attr1.setDjValue("$OO_LOCAL{common}"); String attr1Name = "attr1"; attributes.put(attr1Name, attr1); CmsCIAttribute attr2 = new CmsCIAttribute(); attr2.setDjValue("$OO_LOCAL{store-name}"); String attr2Name = "attr2"; attributes.put(attr2Name, attr2); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals(attr1Name)) { assertEquals(djAfter, "lc1-gl1-ver-cl1-1-st1-v1-cl1-1.0.SNAPSHOT"); } else if (djKey.equals(attr2Name)) { assertEquals(djAfter, "commons-st1-cl1-up"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 111) public void processLocalVarMixed() { Map<String, String> cloudVars = new HashMap<>(3); cloudVars.put("myCloud", "987654"); Map<String, String> globalVars = new HashMap<>(3); globalVars.put("myGlobal", "1212"); Map<String, String> localVars = new HashMap<>(3); localVars.put("myLocal", "8989"); CmsCI ci = new CmsCI(); ci.setCiId(111); ci.setCiName("processLocalVarMixed"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue( "/preamble/$OO_CLOUD{myCloud}/middle/$OO_GLOBAL{myGlobal}/sss/$OO_LOCAL{myLocal}"); String nameOfAttribute = "myMixedAttribute"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals(nameOfAttribute)) { assertEquals(djAfter, "/preamble/987654/middle/1212/sss/8989"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void startTrackingTest() { String scope = ""; CmsWorkOrderSimple woSimple = new CmsWorkOrderSimple(); CmsRfcCISimple rfcCi = new CmsRfcCISimple(); rfcCi.setCiName("mocked"); rfcCi.setCiId(0); rfcCi.setRfcAction("update"); woSimple.setRfcCi(rfcCi); Map<String, List<CmsRfcCISimple>> payLoad = new HashMap<String, List<CmsRfcCISimple>>(); List<CmsRfcCISimple> wb = new ArrayList<CmsRfcCISimple>(); CmsRfcCISimple sim1 = new CmsRfcCISimple(); sim1.setCiId(1); sim1.setCiName("ci-named"); wb.add(sim1); payLoad.put("WatchedBy", wb); List<CmsRfcCISimple> ra = new ArrayList<CmsRfcCISimple>(); CmsRfcCISimple sim2 = new CmsRfcCISimple(); sim2.setCiId(1); sim2.setCiName("ci-named"); ra.add(sim2); payLoad.put("RealizedAs", ra); woSimple.setPayLoad(payLoad); sensorWsController.startTracking(woSimple, scope); String res = this.sensorWsController.startTracking(woSimple, scope); assertEquals(res, "{\"success\"}"); }
|
@RequestMapping(method = RequestMethod.POST, value = "/monitors/start") @ResponseBody public String startTracking( @RequestBody CmsWorkOrderSimple woSimple, @RequestHeader(value = "X-Cms-Scope", required = false) String scope) { logger.info("Inserting fake events for " + woSimple.rfcCi.getCiName() + "; ciId=" + woSimple.rfcCi.getCiId()); if (woSimple.getPayLoad().get("WatchedBy") != null && woSimple.getPayLoad().get("WatchedBy").size() > 0 && woSimple.getPayLoad().get("RealizedAs") != null && woSimple.getPayLoad().get("RealizedAs").size() > 0) { long ciId = woSimple.rfcCi.getCiId(); long manifestId = woSimple.getPayLoad().get("RealizedAs").get(0).getCiId(); if (woSimple.getRfcCi().getRfcAction().equals("add") || woSimple.getRfcCi().getRfcAction().equals("update")) { for (CmsRfcCISimple monitor : woSimple.getPayLoad().get("WatchedBy")) { String source = monitor.getCiName(); sensor.insertFakeEvent(ciId, manifestId, source); } } } return "{\"success\"}"; }
|
SensorWsController { @RequestMapping(method = RequestMethod.POST, value = "/monitors/start") @ResponseBody public String startTracking( @RequestBody CmsWorkOrderSimple woSimple, @RequestHeader(value = "X-Cms-Scope", required = false) String scope) { logger.info("Inserting fake events for " + woSimple.rfcCi.getCiName() + "; ciId=" + woSimple.rfcCi.getCiId()); if (woSimple.getPayLoad().get("WatchedBy") != null && woSimple.getPayLoad().get("WatchedBy").size() > 0 && woSimple.getPayLoad().get("RealizedAs") != null && woSimple.getPayLoad().get("RealizedAs").size() > 0) { long ciId = woSimple.rfcCi.getCiId(); long manifestId = woSimple.getPayLoad().get("RealizedAs").get(0).getCiId(); if (woSimple.getRfcCi().getRfcAction().equals("add") || woSimple.getRfcCi().getRfcAction().equals("update")) { for (CmsRfcCISimple monitor : woSimple.getPayLoad().get("WatchedBy")) { String source = monitor.getCiName(); sensor.insertFakeEvent(ciId, manifestId, source); } } } return "{\"success\"}"; } }
|
SensorWsController { @RequestMapping(method = RequestMethod.POST, value = "/monitors/start") @ResponseBody public String startTracking( @RequestBody CmsWorkOrderSimple woSimple, @RequestHeader(value = "X-Cms-Scope", required = false) String scope) { logger.info("Inserting fake events for " + woSimple.rfcCi.getCiName() + "; ciId=" + woSimple.rfcCi.getCiId()); if (woSimple.getPayLoad().get("WatchedBy") != null && woSimple.getPayLoad().get("WatchedBy").size() > 0 && woSimple.getPayLoad().get("RealizedAs") != null && woSimple.getPayLoad().get("RealizedAs").size() > 0) { long ciId = woSimple.rfcCi.getCiId(); long manifestId = woSimple.getPayLoad().get("RealizedAs").get(0).getCiId(); if (woSimple.getRfcCi().getRfcAction().equals("add") || woSimple.getRfcCi().getRfcAction().equals("update")) { for (CmsRfcCISimple monitor : woSimple.getPayLoad().get("WatchedBy")) { String source = monitor.getCiName(); sensor.insertFakeEvent(ciId, manifestId, source); } } } return "{\"success\"}"; } }
|
SensorWsController { @RequestMapping(method = RequestMethod.POST, value = "/monitors/start") @ResponseBody public String startTracking( @RequestBody CmsWorkOrderSimple woSimple, @RequestHeader(value = "X-Cms-Scope", required = false) String scope) { logger.info("Inserting fake events for " + woSimple.rfcCi.getCiName() + "; ciId=" + woSimple.rfcCi.getCiId()); if (woSimple.getPayLoad().get("WatchedBy") != null && woSimple.getPayLoad().get("WatchedBy").size() > 0 && woSimple.getPayLoad().get("RealizedAs") != null && woSimple.getPayLoad().get("RealizedAs").size() > 0) { long ciId = woSimple.rfcCi.getCiId(); long manifestId = woSimple.getPayLoad().get("RealizedAs").get(0).getCiId(); if (woSimple.getRfcCi().getRfcAction().equals("add") || woSimple.getRfcCi().getRfcAction().equals("update")) { for (CmsRfcCISimple monitor : woSimple.getPayLoad().get("WatchedBy")) { String source = monitor.getCiName(); sensor.insertFakeEvent(ciId, manifestId, source); } } } return "{\"success\"}"; } void setSensorListener(SensorListener sensorListener); void setTsDao(ThresholdsDao tsDao); void setSensorTools(SensorTools sensorTools); void setRestorer(MonitorRestorer restorer); void setCoProcessor(CiOpsProcessor coProcessor); void setOeDao(OpsEventDao oeDao); void setSensor(Sensor sensor); void setSensorHeartBeat(SensorHeartBeat sensorHeartBeat); @RequestMapping(method = RequestMethod.POST, value = "/monitors/start") @ResponseBody String startTracking(
@RequestBody CmsWorkOrderSimple woSimple,
@RequestHeader(value = "X-Cms-Scope", required = false) String scope); @RequestMapping(method = RequestMethod.GET, value = "/monitors/restore") @ResponseBody String restoreMonitors(
@RequestParam(value = "writeMode", required = false, defaultValue = "false") boolean writeMode,
@RequestParam(value = "manifestId", required = false) Long manifestId); @RequestMapping(value = "/ops/events/{ciId}", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, List<CiOpenEvent>>> getCIOpenEvents(@PathVariable long ciId); @RequestMapping(value = "/ops/events", method = RequestMethod.GET) @ResponseBody List<Map<Long, Map<String, List<CiOpenEvent>>>> getOpenEvents(
@RequestParam(value = "ciIds", required = true) String ciIdsStr); @RequestMapping(method = RequestMethod.POST, value = "/ops/events") @ResponseBody List<Map<Long, Map<String, List<CiOpenEvent>>>> processOpenEvents(
@RequestBody Long[] ciIdsAr); @RequestMapping(value = "/ops/states/{ciId}", method = RequestMethod.GET) @ResponseBody Map<String, String> getCIstate(@PathVariable long ciId); @RequestMapping(value = "/ops/states/{ciId}/history", method = RequestMethod.GET) @ResponseBody List<CiChangeStateEvent> getCIstateHist(@PathVariable long ciId,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/ops/states", method = RequestMethod.GET) @ResponseBody List<Map<String, String>> getCisStatesGet(
@RequestParam(value = "ciIds", required = true) String ciIdsStr); @RequestMapping(value = "/ops/states", method = RequestMethod.POST) @ResponseBody List<Map<String, String>> getCisStatesPost(
@RequestBody Long[] ciIdsAr); @RequestMapping(value = "/ops/components/states/counts", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Long>> getManifestStatesCountsGet(
@RequestParam(value = "ids", required = false) String ciIdsStr); @RequestMapping(value = "/ops/components/all/states", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Long>> getAllManifestStates(); @RequestMapping(value = "/ops/components/states/reset", method = RequestMethod.GET) @ResponseBody Map<String, String> resetManifestStates(
@RequestParam(value = "ids", required = false) String ciIdsStr); @RequestMapping(value = "/ops/components/states/count", method = RequestMethod.POST) @ResponseBody Map<Long, Map<String, Long>> getManifestStatesCounts(
@RequestBody Long[] idsAr); @RequestMapping(value = "/ops/components/states", method = RequestMethod.POST) @ResponseBody Map<Long, Map<String, Integer>> getManifestStatesPost(
@RequestBody Long[] idsAr); @RequestMapping(value = "/ops/components/old/states", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Integer>> getManifestStatesGet(
@RequestParam(value = "ids", required = true) String ciIdsStr); @RequestMapping(value = "/ops/events/{ciId}/close/{eventName}", method = RequestMethod.GET) @ResponseBody List<CiOpenEvent> closeCIevent(@PathVariable long ciId, @PathVariable String eventName); @RequestMapping(value = "/ops/events/{ciId}/history/{source}", method = RequestMethod.GET) @ResponseBody Map<String, List<OpsEvent>> getEventHistory(@PathVariable long ciId,
@PathVariable String source,
@RequestParam(value = "threshold", required = true) String[] thresholds,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/ops/events/{ciId}/history", method = RequestMethod.GET) @ResponseBody List<OpsEvent> getAllEventHistory(@PathVariable long ciId,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/esper/stmts", method = RequestMethod.GET) @ResponseBody Map<String, String> getLoadedStmts(); @RequestMapping(value = "/esper/stmts/count", method = RequestMethod.GET) @ResponseBody Map<String, Integer> getLoadedStmtsCount(); @RequestMapping(value = "/esper/stmts/{ciId}/load/{source}", method = RequestMethod.GET) @ResponseBody Map<String, String> loadStmts(@PathVariable long ciId,
@PathVariable String source); @RequestMapping(value = "/ops/events/{ciId}/send", method = RequestMethod.GET) @ResponseBody String sendEmptyEvent(@PathVariable long ciId,
@RequestParam(value = "source", required = true) String source,
@RequestParam(value = "manifestId", required = true) long manifestId); @RequestMapping(value = "/log/{ciId}/{action}", method = RequestMethod.GET) @ResponseBody String setLogingForCi(@PathVariable long ciId,
@PathVariable String action); @RequestMapping(value = "/channels/status", method = RequestMethod.GET) @ResponseBody Map<String, ChannelState> getChannelStates(); @RequestMapping(value = "/utils/validatethresholds", method = RequestMethod.GET) @ResponseBody String validateThresholds(); @RequestMapping(value = "/status", method = RequestMethod.GET) @ResponseBody String checkStatus(); @RequestMapping(value = "/events/count", method = RequestMethod.GET) @ResponseBody String getEventProcessingCount(); }
|
SensorWsController { @RequestMapping(method = RequestMethod.POST, value = "/monitors/start") @ResponseBody public String startTracking( @RequestBody CmsWorkOrderSimple woSimple, @RequestHeader(value = "X-Cms-Scope", required = false) String scope) { logger.info("Inserting fake events for " + woSimple.rfcCi.getCiName() + "; ciId=" + woSimple.rfcCi.getCiId()); if (woSimple.getPayLoad().get("WatchedBy") != null && woSimple.getPayLoad().get("WatchedBy").size() > 0 && woSimple.getPayLoad().get("RealizedAs") != null && woSimple.getPayLoad().get("RealizedAs").size() > 0) { long ciId = woSimple.rfcCi.getCiId(); long manifestId = woSimple.getPayLoad().get("RealizedAs").get(0).getCiId(); if (woSimple.getRfcCi().getRfcAction().equals("add") || woSimple.getRfcCi().getRfcAction().equals("update")) { for (CmsRfcCISimple monitor : woSimple.getPayLoad().get("WatchedBy")) { String source = monitor.getCiName(); sensor.insertFakeEvent(ciId, manifestId, source); } } } return "{\"success\"}"; } void setSensorListener(SensorListener sensorListener); void setTsDao(ThresholdsDao tsDao); void setSensorTools(SensorTools sensorTools); void setRestorer(MonitorRestorer restorer); void setCoProcessor(CiOpsProcessor coProcessor); void setOeDao(OpsEventDao oeDao); void setSensor(Sensor sensor); void setSensorHeartBeat(SensorHeartBeat sensorHeartBeat); @RequestMapping(method = RequestMethod.POST, value = "/monitors/start") @ResponseBody String startTracking(
@RequestBody CmsWorkOrderSimple woSimple,
@RequestHeader(value = "X-Cms-Scope", required = false) String scope); @RequestMapping(method = RequestMethod.GET, value = "/monitors/restore") @ResponseBody String restoreMonitors(
@RequestParam(value = "writeMode", required = false, defaultValue = "false") boolean writeMode,
@RequestParam(value = "manifestId", required = false) Long manifestId); @RequestMapping(value = "/ops/events/{ciId}", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, List<CiOpenEvent>>> getCIOpenEvents(@PathVariable long ciId); @RequestMapping(value = "/ops/events", method = RequestMethod.GET) @ResponseBody List<Map<Long, Map<String, List<CiOpenEvent>>>> getOpenEvents(
@RequestParam(value = "ciIds", required = true) String ciIdsStr); @RequestMapping(method = RequestMethod.POST, value = "/ops/events") @ResponseBody List<Map<Long, Map<String, List<CiOpenEvent>>>> processOpenEvents(
@RequestBody Long[] ciIdsAr); @RequestMapping(value = "/ops/states/{ciId}", method = RequestMethod.GET) @ResponseBody Map<String, String> getCIstate(@PathVariable long ciId); @RequestMapping(value = "/ops/states/{ciId}/history", method = RequestMethod.GET) @ResponseBody List<CiChangeStateEvent> getCIstateHist(@PathVariable long ciId,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/ops/states", method = RequestMethod.GET) @ResponseBody List<Map<String, String>> getCisStatesGet(
@RequestParam(value = "ciIds", required = true) String ciIdsStr); @RequestMapping(value = "/ops/states", method = RequestMethod.POST) @ResponseBody List<Map<String, String>> getCisStatesPost(
@RequestBody Long[] ciIdsAr); @RequestMapping(value = "/ops/components/states/counts", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Long>> getManifestStatesCountsGet(
@RequestParam(value = "ids", required = false) String ciIdsStr); @RequestMapping(value = "/ops/components/all/states", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Long>> getAllManifestStates(); @RequestMapping(value = "/ops/components/states/reset", method = RequestMethod.GET) @ResponseBody Map<String, String> resetManifestStates(
@RequestParam(value = "ids", required = false) String ciIdsStr); @RequestMapping(value = "/ops/components/states/count", method = RequestMethod.POST) @ResponseBody Map<Long, Map<String, Long>> getManifestStatesCounts(
@RequestBody Long[] idsAr); @RequestMapping(value = "/ops/components/states", method = RequestMethod.POST) @ResponseBody Map<Long, Map<String, Integer>> getManifestStatesPost(
@RequestBody Long[] idsAr); @RequestMapping(value = "/ops/components/old/states", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Integer>> getManifestStatesGet(
@RequestParam(value = "ids", required = true) String ciIdsStr); @RequestMapping(value = "/ops/events/{ciId}/close/{eventName}", method = RequestMethod.GET) @ResponseBody List<CiOpenEvent> closeCIevent(@PathVariable long ciId, @PathVariable String eventName); @RequestMapping(value = "/ops/events/{ciId}/history/{source}", method = RequestMethod.GET) @ResponseBody Map<String, List<OpsEvent>> getEventHistory(@PathVariable long ciId,
@PathVariable String source,
@RequestParam(value = "threshold", required = true) String[] thresholds,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/ops/events/{ciId}/history", method = RequestMethod.GET) @ResponseBody List<OpsEvent> getAllEventHistory(@PathVariable long ciId,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/esper/stmts", method = RequestMethod.GET) @ResponseBody Map<String, String> getLoadedStmts(); @RequestMapping(value = "/esper/stmts/count", method = RequestMethod.GET) @ResponseBody Map<String, Integer> getLoadedStmtsCount(); @RequestMapping(value = "/esper/stmts/{ciId}/load/{source}", method = RequestMethod.GET) @ResponseBody Map<String, String> loadStmts(@PathVariable long ciId,
@PathVariable String source); @RequestMapping(value = "/ops/events/{ciId}/send", method = RequestMethod.GET) @ResponseBody String sendEmptyEvent(@PathVariable long ciId,
@RequestParam(value = "source", required = true) String source,
@RequestParam(value = "manifestId", required = true) long manifestId); @RequestMapping(value = "/log/{ciId}/{action}", method = RequestMethod.GET) @ResponseBody String setLogingForCi(@PathVariable long ciId,
@PathVariable String action); @RequestMapping(value = "/channels/status", method = RequestMethod.GET) @ResponseBody Map<String, ChannelState> getChannelStates(); @RequestMapping(value = "/utils/validatethresholds", method = RequestMethod.GET) @ResponseBody String validateThresholds(); @RequestMapping(value = "/status", method = RequestMethod.GET) @ResponseBody String checkStatus(); @RequestMapping(value = "/events/count", method = RequestMethod.GET) @ResponseBody String getEventProcessingCount(); }
|
@Test(priority = 115) public void processLocalVarTrips() { Map<String, String> localVars = new HashMap<>(3); localVars.put("groupId", "esb"); localVars.put("artifactId", "service"); localVars.put("extension", "html"); CmsCI ci = new CmsCI(); ci.setCiId(115); ci.setCiName("processLocalVarTrips"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("$OO_LOCAL{groupId}:$OO_LOCAL{artifactId}:$OO_LOCAL{extension}"); String nameOfAttribute = "myArtifactGav"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, null, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, null, null, localVars); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals(nameOfAttribute)) { assertEquals(djAfter, "esb:service:html"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 122) public void processLocalVarNegativeSpelling() { Map<String, String> localVars = new HashMap<>(1); localVars.put("groupId", "barrrrrr"); CmsCI ci = new CmsCI(); ci.setCiId(122); ci.setCiName("processLocalVarNegativeSpelling"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(1); CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("$OO_NOOCAL{groupId}"); String nameOfAttribute = "irrelevantname"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, null, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, null, null, localVars); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals(nameOfAttribute)) { assertEquals(djAfter, "$OO_NOOCAL{groupId}"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 130, expectedExceptions = CIValidationException.class) public void processLocalVarNegativeMissingLocal() { Map<String, String> localVars = new HashMap<>(1); localVars.put("aaaaaa", "ignore-me"); CmsCI ci = new CmsCI(); ci.setCiId(130); ci.setCiName("processLocalVarNegativeMissingLocal"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(1); CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("$OO_LOCAL{this-is-not-resolved}"); String nameOfAttribute = "trouble"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, null, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, null, null, localVars); dumpCmsCIAttributes(ci); }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 132, expectedExceptions = CIValidationException.class) public void processLocalVarNegativeMissingGlobal() { CmsCI ci = new CmsCI(); ci.setCiId(132); ci.setCiName("processLocalVarNegativeMissingGlobal"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(1); CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("$OO_GLOBAL{where-is-it}"); String nameOfAttribute = "nowhere"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, null, null); dumpCmsCIAttributes(ci); util.processAllVars(ci, Collections.EMPTY_MAP, Collections.EMPTY_MAP, Collections.EMPTY_MAP); dumpCmsCIAttributes(ci); }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 132, expectedExceptions = CIValidationException.class) public void processLocalVarNegativeMissingGlobal2() { Map<String, String> globalVars = new HashMap<>(1); globalVars.put("cc", "ignore-distraction"); CmsCI ci = new CmsCI(); ci.setCiId(132); ci.setCiName("processLocalVarNegativeMissingGlobal2"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(1); CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("$OO_GLOBAL{where?}"); String nameOfAttribute = "nowh---ere"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, globalVars, null); dumpCmsCIAttributes(ci); util.processAllVars(ci, null, globalVars, null); dumpCmsCIAttributes(ci); }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 133, expectedExceptions = CIValidationException.class) public void processLocalVarNegativeMissingCloud1() { Map<String, String> cloudVars = new HashMap<>(1); cloudVars.put("bb", "ignore-bb"); CmsCI ci = new CmsCI(); ci.setCiId(133); ci.setCiName("processLocalVarNegativeMissingCloud1"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(1); CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("$OO_CLOUD{not-cloudy}"); String nameOfAttribute = "sun"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, null, null); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, null, null); dumpCmsCIAttributes(ci); }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 134, expectedExceptions = CIValidationException.class) public void processLocalVarNegativeMissingCloud() { CmsCI ci = new CmsCI(); ci.setCiId(134); ci.setCiName("processLocalVarNegativeMissingCloud"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(1); CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("$OO_CLOUD{not-cloudy}"); String nameOfAttribute = "sun"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, null, null); dumpCmsCIAttributes(ci); util.processAllVars(ci, Collections.EMPTY_MAP, Collections.EMPTY_MAP, Collections.EMPTY_MAP); dumpCmsCIAttributes(ci); }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 140) public void processLocalVarDemo() { Map<String, String> cloudVars = new HashMap<>(3); cloudVars.put("version", "2.0"); Map<String, String> globalVars = new HashMap<>(3); globalVars.put("version", "$OO_CLOUD{version}"); Map<String, String> localVars = new HashMap<>(3); localVars.put("groupId", "esb"); localVars.put("artifactId", "service"); CmsCI ci = new CmsCI(); ci.setCiId(140); ci.setCiName("processLocalVarDemo"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("$OO_LOCAL{groupId}:$OO_LOCAL{artifactId}:$OO_GLOBAL{version}"); String nameOfAttribute = "myArtifactGav"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals(nameOfAttribute)) { assertEquals(djAfter, "esb:service:2.0"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test(priority = 150) public void processLocalVarBlankValue() { Map<String, String> cloudVars = new HashMap<>(3); cloudVars.put("FOO", ""); CmsCI ci = new CmsCI(); ci.setCiId(150); ci.setCiName("processLocalVarBlankValue"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(1); CmsCIAttribute attrL = new CmsCIAttribute(); attrL.setDjValue("$OO_CLOUD{FOO}"); String nameOfAttribute = "testingABlank"; attributes.put(nameOfAttribute, attrL); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, null, null); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, null, null); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals(nameOfAttribute)) { assertEquals(djAfter, "", "this is not a empty string as expected"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void testErrorMessage() { String errorMessage = "tomcat@p1/1 attribute '' [pre_shutdown_command] references unknown local variable 'DEPLOYCONTEXT'"; assertEquals( util.getErrorMessage("tomcat", "/LOCAL2/A1/testEnv2/manifest/p1/1", "pre_shutdown_command", null, "DEPLOYCONTEXT", "\\$OO_LOCAL\\{"), errorMessage); }
|
private String getErrorMessage(VariableContext variableContext, String resolvedValue, String varName, String varPfx) { return getErrorMessage(variableContext.getCiName(), variableContext.getNsPath(), variableContext.getAttrName(), resolvedValue, varName, varPfx) ; }
|
CmsUtil { private String getErrorMessage(VariableContext variableContext, String resolvedValue, String varName, String varPfx) { return getErrorMessage(variableContext.getCiName(), variableContext.getNsPath(), variableContext.getAttrName(), resolvedValue, varName, varPfx) ; } }
|
CmsUtil { private String getErrorMessage(VariableContext variableContext, String resolvedValue, String varName, String varPfx) { return getErrorMessage(variableContext.getCiName(), variableContext.getNsPath(), variableContext.getAttrName(), resolvedValue, varName, varPfx) ; } }
|
CmsUtil { private String getErrorMessage(VariableContext variableContext, String resolvedValue, String varName, String varPfx) { return getErrorMessage(variableContext.getCiName(), variableContext.getNsPath(), variableContext.getAttrName(), resolvedValue, varName, varPfx) ; } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { private String getErrorMessage(VariableContext variableContext, String resolvedValue, String varName, String varPfx) { return getErrorMessage(variableContext.getCiName(), variableContext.getNsPath(), variableContext.getAttrName(), resolvedValue, varName, varPfx) ; } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void getStates() { String ciIdsStr = CI_ID_A + ",20,30"; List<Map<String, String>> states = this.sensorWsController .getCisStatesGet(ciIdsStr); assert (states.size() == 3); List<String> gottenKeys = new ArrayList<String>(3); for (Map<String, String> m : states) { gottenKeys.add(m.get("id")); } String[] expected = new String[] { String.valueOf(CI_ID_A), "20", "30" }; assert (gottenKeys.containsAll(Arrays.asList(expected))); }
|
@RequestMapping(value = "/ops/states", method = RequestMethod.GET) @ResponseBody public List<Map<String, String>> getCisStatesGet( @RequestParam(value = "ciIds", required = true) String ciIdsStr) { String[] ciIdsAr = ciIdsStr.split(","); List<Long> ciIds = new ArrayList<Long>(); for (String ciId : ciIdsAr) { try { ciIds.add(Long.valueOf(ciId)); } catch (NumberFormatException ex) { } } return getCisStates(ciIds); }
|
SensorWsController { @RequestMapping(value = "/ops/states", method = RequestMethod.GET) @ResponseBody public List<Map<String, String>> getCisStatesGet( @RequestParam(value = "ciIds", required = true) String ciIdsStr) { String[] ciIdsAr = ciIdsStr.split(","); List<Long> ciIds = new ArrayList<Long>(); for (String ciId : ciIdsAr) { try { ciIds.add(Long.valueOf(ciId)); } catch (NumberFormatException ex) { } } return getCisStates(ciIds); } }
|
SensorWsController { @RequestMapping(value = "/ops/states", method = RequestMethod.GET) @ResponseBody public List<Map<String, String>> getCisStatesGet( @RequestParam(value = "ciIds", required = true) String ciIdsStr) { String[] ciIdsAr = ciIdsStr.split(","); List<Long> ciIds = new ArrayList<Long>(); for (String ciId : ciIdsAr) { try { ciIds.add(Long.valueOf(ciId)); } catch (NumberFormatException ex) { } } return getCisStates(ciIds); } }
|
SensorWsController { @RequestMapping(value = "/ops/states", method = RequestMethod.GET) @ResponseBody public List<Map<String, String>> getCisStatesGet( @RequestParam(value = "ciIds", required = true) String ciIdsStr) { String[] ciIdsAr = ciIdsStr.split(","); List<Long> ciIds = new ArrayList<Long>(); for (String ciId : ciIdsAr) { try { ciIds.add(Long.valueOf(ciId)); } catch (NumberFormatException ex) { } } return getCisStates(ciIds); } void setSensorListener(SensorListener sensorListener); void setTsDao(ThresholdsDao tsDao); void setSensorTools(SensorTools sensorTools); void setRestorer(MonitorRestorer restorer); void setCoProcessor(CiOpsProcessor coProcessor); void setOeDao(OpsEventDao oeDao); void setSensor(Sensor sensor); void setSensorHeartBeat(SensorHeartBeat sensorHeartBeat); @RequestMapping(method = RequestMethod.POST, value = "/monitors/start") @ResponseBody String startTracking(
@RequestBody CmsWorkOrderSimple woSimple,
@RequestHeader(value = "X-Cms-Scope", required = false) String scope); @RequestMapping(method = RequestMethod.GET, value = "/monitors/restore") @ResponseBody String restoreMonitors(
@RequestParam(value = "writeMode", required = false, defaultValue = "false") boolean writeMode,
@RequestParam(value = "manifestId", required = false) Long manifestId); @RequestMapping(value = "/ops/events/{ciId}", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, List<CiOpenEvent>>> getCIOpenEvents(@PathVariable long ciId); @RequestMapping(value = "/ops/events", method = RequestMethod.GET) @ResponseBody List<Map<Long, Map<String, List<CiOpenEvent>>>> getOpenEvents(
@RequestParam(value = "ciIds", required = true) String ciIdsStr); @RequestMapping(method = RequestMethod.POST, value = "/ops/events") @ResponseBody List<Map<Long, Map<String, List<CiOpenEvent>>>> processOpenEvents(
@RequestBody Long[] ciIdsAr); @RequestMapping(value = "/ops/states/{ciId}", method = RequestMethod.GET) @ResponseBody Map<String, String> getCIstate(@PathVariable long ciId); @RequestMapping(value = "/ops/states/{ciId}/history", method = RequestMethod.GET) @ResponseBody List<CiChangeStateEvent> getCIstateHist(@PathVariable long ciId,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/ops/states", method = RequestMethod.GET) @ResponseBody List<Map<String, String>> getCisStatesGet(
@RequestParam(value = "ciIds", required = true) String ciIdsStr); @RequestMapping(value = "/ops/states", method = RequestMethod.POST) @ResponseBody List<Map<String, String>> getCisStatesPost(
@RequestBody Long[] ciIdsAr); @RequestMapping(value = "/ops/components/states/counts", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Long>> getManifestStatesCountsGet(
@RequestParam(value = "ids", required = false) String ciIdsStr); @RequestMapping(value = "/ops/components/all/states", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Long>> getAllManifestStates(); @RequestMapping(value = "/ops/components/states/reset", method = RequestMethod.GET) @ResponseBody Map<String, String> resetManifestStates(
@RequestParam(value = "ids", required = false) String ciIdsStr); @RequestMapping(value = "/ops/components/states/count", method = RequestMethod.POST) @ResponseBody Map<Long, Map<String, Long>> getManifestStatesCounts(
@RequestBody Long[] idsAr); @RequestMapping(value = "/ops/components/states", method = RequestMethod.POST) @ResponseBody Map<Long, Map<String, Integer>> getManifestStatesPost(
@RequestBody Long[] idsAr); @RequestMapping(value = "/ops/components/old/states", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Integer>> getManifestStatesGet(
@RequestParam(value = "ids", required = true) String ciIdsStr); @RequestMapping(value = "/ops/events/{ciId}/close/{eventName}", method = RequestMethod.GET) @ResponseBody List<CiOpenEvent> closeCIevent(@PathVariable long ciId, @PathVariable String eventName); @RequestMapping(value = "/ops/events/{ciId}/history/{source}", method = RequestMethod.GET) @ResponseBody Map<String, List<OpsEvent>> getEventHistory(@PathVariable long ciId,
@PathVariable String source,
@RequestParam(value = "threshold", required = true) String[] thresholds,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/ops/events/{ciId}/history", method = RequestMethod.GET) @ResponseBody List<OpsEvent> getAllEventHistory(@PathVariable long ciId,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/esper/stmts", method = RequestMethod.GET) @ResponseBody Map<String, String> getLoadedStmts(); @RequestMapping(value = "/esper/stmts/count", method = RequestMethod.GET) @ResponseBody Map<String, Integer> getLoadedStmtsCount(); @RequestMapping(value = "/esper/stmts/{ciId}/load/{source}", method = RequestMethod.GET) @ResponseBody Map<String, String> loadStmts(@PathVariable long ciId,
@PathVariable String source); @RequestMapping(value = "/ops/events/{ciId}/send", method = RequestMethod.GET) @ResponseBody String sendEmptyEvent(@PathVariable long ciId,
@RequestParam(value = "source", required = true) String source,
@RequestParam(value = "manifestId", required = true) long manifestId); @RequestMapping(value = "/log/{ciId}/{action}", method = RequestMethod.GET) @ResponseBody String setLogingForCi(@PathVariable long ciId,
@PathVariable String action); @RequestMapping(value = "/channels/status", method = RequestMethod.GET) @ResponseBody Map<String, ChannelState> getChannelStates(); @RequestMapping(value = "/utils/validatethresholds", method = RequestMethod.GET) @ResponseBody String validateThresholds(); @RequestMapping(value = "/status", method = RequestMethod.GET) @ResponseBody String checkStatus(); @RequestMapping(value = "/events/count", method = RequestMethod.GET) @ResponseBody String getEventProcessingCount(); }
|
SensorWsController { @RequestMapping(value = "/ops/states", method = RequestMethod.GET) @ResponseBody public List<Map<String, String>> getCisStatesGet( @RequestParam(value = "ciIds", required = true) String ciIdsStr) { String[] ciIdsAr = ciIdsStr.split(","); List<Long> ciIds = new ArrayList<Long>(); for (String ciId : ciIdsAr) { try { ciIds.add(Long.valueOf(ciId)); } catch (NumberFormatException ex) { } } return getCisStates(ciIds); } void setSensorListener(SensorListener sensorListener); void setTsDao(ThresholdsDao tsDao); void setSensorTools(SensorTools sensorTools); void setRestorer(MonitorRestorer restorer); void setCoProcessor(CiOpsProcessor coProcessor); void setOeDao(OpsEventDao oeDao); void setSensor(Sensor sensor); void setSensorHeartBeat(SensorHeartBeat sensorHeartBeat); @RequestMapping(method = RequestMethod.POST, value = "/monitors/start") @ResponseBody String startTracking(
@RequestBody CmsWorkOrderSimple woSimple,
@RequestHeader(value = "X-Cms-Scope", required = false) String scope); @RequestMapping(method = RequestMethod.GET, value = "/monitors/restore") @ResponseBody String restoreMonitors(
@RequestParam(value = "writeMode", required = false, defaultValue = "false") boolean writeMode,
@RequestParam(value = "manifestId", required = false) Long manifestId); @RequestMapping(value = "/ops/events/{ciId}", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, List<CiOpenEvent>>> getCIOpenEvents(@PathVariable long ciId); @RequestMapping(value = "/ops/events", method = RequestMethod.GET) @ResponseBody List<Map<Long, Map<String, List<CiOpenEvent>>>> getOpenEvents(
@RequestParam(value = "ciIds", required = true) String ciIdsStr); @RequestMapping(method = RequestMethod.POST, value = "/ops/events") @ResponseBody List<Map<Long, Map<String, List<CiOpenEvent>>>> processOpenEvents(
@RequestBody Long[] ciIdsAr); @RequestMapping(value = "/ops/states/{ciId}", method = RequestMethod.GET) @ResponseBody Map<String, String> getCIstate(@PathVariable long ciId); @RequestMapping(value = "/ops/states/{ciId}/history", method = RequestMethod.GET) @ResponseBody List<CiChangeStateEvent> getCIstateHist(@PathVariable long ciId,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/ops/states", method = RequestMethod.GET) @ResponseBody List<Map<String, String>> getCisStatesGet(
@RequestParam(value = "ciIds", required = true) String ciIdsStr); @RequestMapping(value = "/ops/states", method = RequestMethod.POST) @ResponseBody List<Map<String, String>> getCisStatesPost(
@RequestBody Long[] ciIdsAr); @RequestMapping(value = "/ops/components/states/counts", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Long>> getManifestStatesCountsGet(
@RequestParam(value = "ids", required = false) String ciIdsStr); @RequestMapping(value = "/ops/components/all/states", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Long>> getAllManifestStates(); @RequestMapping(value = "/ops/components/states/reset", method = RequestMethod.GET) @ResponseBody Map<String, String> resetManifestStates(
@RequestParam(value = "ids", required = false) String ciIdsStr); @RequestMapping(value = "/ops/components/states/count", method = RequestMethod.POST) @ResponseBody Map<Long, Map<String, Long>> getManifestStatesCounts(
@RequestBody Long[] idsAr); @RequestMapping(value = "/ops/components/states", method = RequestMethod.POST) @ResponseBody Map<Long, Map<String, Integer>> getManifestStatesPost(
@RequestBody Long[] idsAr); @RequestMapping(value = "/ops/components/old/states", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Integer>> getManifestStatesGet(
@RequestParam(value = "ids", required = true) String ciIdsStr); @RequestMapping(value = "/ops/events/{ciId}/close/{eventName}", method = RequestMethod.GET) @ResponseBody List<CiOpenEvent> closeCIevent(@PathVariable long ciId, @PathVariable String eventName); @RequestMapping(value = "/ops/events/{ciId}/history/{source}", method = RequestMethod.GET) @ResponseBody Map<String, List<OpsEvent>> getEventHistory(@PathVariable long ciId,
@PathVariable String source,
@RequestParam(value = "threshold", required = true) String[] thresholds,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/ops/events/{ciId}/history", method = RequestMethod.GET) @ResponseBody List<OpsEvent> getAllEventHistory(@PathVariable long ciId,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/esper/stmts", method = RequestMethod.GET) @ResponseBody Map<String, String> getLoadedStmts(); @RequestMapping(value = "/esper/stmts/count", method = RequestMethod.GET) @ResponseBody Map<String, Integer> getLoadedStmtsCount(); @RequestMapping(value = "/esper/stmts/{ciId}/load/{source}", method = RequestMethod.GET) @ResponseBody Map<String, String> loadStmts(@PathVariable long ciId,
@PathVariable String source); @RequestMapping(value = "/ops/events/{ciId}/send", method = RequestMethod.GET) @ResponseBody String sendEmptyEvent(@PathVariable long ciId,
@RequestParam(value = "source", required = true) String source,
@RequestParam(value = "manifestId", required = true) long manifestId); @RequestMapping(value = "/log/{ciId}/{action}", method = RequestMethod.GET) @ResponseBody String setLogingForCi(@PathVariable long ciId,
@PathVariable String action); @RequestMapping(value = "/channels/status", method = RequestMethod.GET) @ResponseBody Map<String, ChannelState> getChannelStates(); @RequestMapping(value = "/utils/validatethresholds", method = RequestMethod.GET) @ResponseBody String validateThresholds(); @RequestMapping(value = "/status", method = RequestMethod.GET) @ResponseBody String checkStatus(); @RequestMapping(value = "/events/count", method = RequestMethod.GET) @ResponseBody String getEventProcessingCount(); }
|
@Test(priority = 105) public void processGlobalVarUsingBothCloudGlobal() { Map<String, String> cloudVars = new HashMap<>(3); cloudVars.put("common", "cl1"); cloudVars.put("store", "st1"); cloudVars.put("common", "glcloud"); Map<String, String> globalVars = new HashMap<>(3); globalVars.put("common", "gl1"); globalVars.put("version", "1.0"); globalVars.put("cldstr", "$OO_CLOUD{store}"); globalVars.put("dir", "up"); globalVars .put("globalcloudvar1", "Global var $OO_GLOBAL{common} has cloud var $OO_CLOUD{common}"); Map<String, String> localVars = new HashMap<>(3); localVars.put("common", "lc1-$OO_GLOBAL{common}-ver-$OO_CLOUD{common}-1-$OO_CLOUD{store}-v1-$OO_CLOUD{common}-$OO_GLOBAL{version}.SNAPSHOT"); localVars.put("store-name", "commons-$OO_GLOBAL{cldstr}-$OO_CLOUD{common}-$OO_GLOBAL{dir}"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("processLocalVarUsingBothCloudGlobal"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attr4 = new CmsCIAttribute(); attr4.setDjValue("$OO_GLOBAL{globalcloudvar1}"); String attr4Name = "attr4"; attributes.put(attr4Name, attr4); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); for (Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals(attr4Name)) { assertEquals(djAfter, "Global var gl1 has cloud var glcloud"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void localVarRefersAnotherLVar() { Map<String, String> localVars = new HashMap<>(3); localVars.put("lv1", "localVar1"); localVars.put("lv2", "$OO_LOCAL{lv1}"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("localVarRefersAnotherLVar"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attr4 = new CmsCIAttribute(); attr4.setDjValue("$OO_LOCAL{lv2}"); attributes.put("localVarRefersAnotherLVar", attr4); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Map.Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, null, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, null, null, localVars); dumpCmsCIAttributes(ci); for (Map.Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals("localVarRefersAnotherLVar")) { assertEquals(djAfter, "localVar1"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void localVarRefersAnotherLVarWithPrefix() { Map<String, String> localVars = new HashMap<>(3); localVars.put("lv1", "localVar1"); localVars.put("lv2", "$OO_LOCAL{lv1}"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("localVarRefersAnotherLVar"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attr4 = new CmsCIAttribute(); attr4.setDjValue("Prefix $OO_LOCAL{lv2}"); attributes.put("localVarRefersAnotherLVar", attr4); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Map.Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, null, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, null, null, localVars); dumpCmsCIAttributes(ci); for (Map.Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals("localVarRefersAnotherLVar")) { assertEquals(djAfter, "Prefix localVar1"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void localVarRefersAnotherLVarWithSuffix() { Map<String, String> localVars = new HashMap<>(3); localVars.put("lv1", "localVar1"); localVars.put("lv2", "$OO_LOCAL{lv1}"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("localVarRefersAnotherLVar"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attr4 = new CmsCIAttribute(); attr4.setDjValue("$OO_LOCAL{lv2}Suffix"); attributes.put("localVarRefersAnotherLVar", attr4); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Map.Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, null, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, null, null, localVars); dumpCmsCIAttributes(ci); for (Map.Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals("localVarRefersAnotherLVar")) { assertEquals(djAfter, "localVar1Suffix"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void localVarRefersAnotherLVarWithPrefixSuffix() { Map<String, String> localVars = new HashMap<>(3); localVars.put("lv1", "localVar1"); localVars.put("lv2", "$OO_LOCAL{lv1}"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("localVarRefersAnotherLVar"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attr4 = new CmsCIAttribute(); attr4.setDjValue("Prefix$OO_LOCAL{lv2}Suffix"); attributes.put("localVarRefersAnotherLVar", attr4); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Map.Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, null, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, null, null, localVars); dumpCmsCIAttributes(ci); for (Map.Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals("localVarRefersAnotherLVar")) { assertEquals(djAfter, "PrefixlocalVar1Suffix"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void localVarRefersAnotherGVarWithPrefixSuffix() { Map<String, String> localVars = new HashMap<>(3); localVars.put("lv1", "$OO_GLOBAL{gv1}"); localVars.put("lv2", "$OO_LOCAL{lv1}"); Map<String, String> globalVars = new HashMap<>(3); globalVars.put("gv1", "globalVar1"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("localVarRefersAnotherLVar"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attr4 = new CmsCIAttribute(); attr4.setDjValue("Prefix$OO_LOCAL{lv2}Suffix"); attributes.put("localVarRefersAnotherLVar", attr4); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Map.Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, null, globalVars, localVars); dumpCmsCIAttributes(ci); for (Map.Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals("localVarRefersAnotherLVar")) { assertEquals(djAfter, "PrefixglobalVar1Suffix"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void localVarRefersAnotherGVarWithPrefix() { Map<String, String> localVars = new HashMap<>(3); localVars.put("lv1", "$OO_GLOBAL{gv1}"); localVars.put("lv2", "$OO_LOCAL{lv1}"); Map<String, String> globalVars = new HashMap<>(3); globalVars.put("gv1", "globalVar1"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("localVarRefersAnotherLVar"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attr4 = new CmsCIAttribute(); attr4.setDjValue("Prefix$OO_LOCAL{lv2}"); attributes.put("localVarRefersAnotherLVar", attr4); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Map.Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(null, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, null, globalVars, localVars); dumpCmsCIAttributes(ci); for (Map.Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals("localVarRefersAnotherLVar")) { assertEquals(djAfter, "PrefixglobalVar1"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void localVarRefersAnotherCVarWithPrefix() { Map<String, String> localVars = new HashMap<>(3); localVars.put("lv1", "$OO_CLOUD{cv1}"); localVars.put("lv2", "$OO_LOCAL{lv1}"); Map<String, String> globalVars = new HashMap<>(3); globalVars.put("gv1", "globalVar1"); Map<String, String> cloudVars = new HashMap<>(3); cloudVars.put("cv1", "cloudVar1"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("localVarRefersAnotherLVar"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attr4 = new CmsCIAttribute(); attr4.setDjValue("Prefix$OO_LOCAL{lv2}"); attributes.put("localVarRefersAnotherLVar", attr4); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Map.Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); for (Map.Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals("localVarRefersAnotherLVar")) { assertEquals(djAfter, "PrefixcloudVar1"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void localVarRefersAnotherCVarWithSuffixPrefix() { Map<String, String> localVars = new HashMap<>(3); localVars.put("lv1", "$OO_CLOUD{cv1}"); localVars.put("lv2", "$OO_LOCAL{lv1}"); Map<String, String> globalVars = new HashMap<>(3); globalVars.put("gv1", "globalVar1"); Map<String, String> cloudVars = new HashMap<>(3); cloudVars.put("cv1", "cloudVar1"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("localVarRefersAnotherLVar"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attr4 = new CmsCIAttribute(); attr4.setDjValue("Prefix $OO_LOCAL{lv2} Suffix"); attributes.put("localVarRefersAnotherLVar", attr4); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Map.Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); for (Map.Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals("localVarRefersAnotherLVar")) { assertEquals(djAfter, "Prefix cloudVar1 Suffix"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void localVarRefersToGV() { Map<String, String> localVars = new HashMap<>(3); localVars.put("lv1", "$OO_GLOBAL{gv1}"); Map<String, String> globalVars = new HashMap<>(3); globalVars.put("gv1", "globalVar1"); Map<String, String> cloudVars = new HashMap<>(3); cloudVars.put("cv1", "cloudVar1"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("localVarRefersAnotherGVar"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attr4 = new CmsCIAttribute(); attr4.setDjValue("Prefix $OO_LOCAL{lv1} Suffix"); attributes.put("localVarRefersAnotherLVar", attr4); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Map.Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); for (Map.Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals("localVarRefersAnotherLVar")) { assertEquals(djAfter, "Prefix globalVar1 Suffix"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
@Test public void getCIState() { Map<String, String> stateMap = new HashMap<String, String>(1); stateMap = this.sensorWsController.getCIstate(CI_ID_A); assert (CI_ID_AVAL.equals(stateMap.get("state"))); }
|
@RequestMapping(value = "/ops/states/{ciId}", method = RequestMethod.GET) @ResponseBody public Map<String, String> getCIstate(@PathVariable long ciId) { String ciState = coProcessor.getCIstate(ciId); Map<String, String> result = new HashMap<String, String>(); result.put("id", String.valueOf(ciId)); result.put("state", ciState); return result; }
|
SensorWsController { @RequestMapping(value = "/ops/states/{ciId}", method = RequestMethod.GET) @ResponseBody public Map<String, String> getCIstate(@PathVariable long ciId) { String ciState = coProcessor.getCIstate(ciId); Map<String, String> result = new HashMap<String, String>(); result.put("id", String.valueOf(ciId)); result.put("state", ciState); return result; } }
|
SensorWsController { @RequestMapping(value = "/ops/states/{ciId}", method = RequestMethod.GET) @ResponseBody public Map<String, String> getCIstate(@PathVariable long ciId) { String ciState = coProcessor.getCIstate(ciId); Map<String, String> result = new HashMap<String, String>(); result.put("id", String.valueOf(ciId)); result.put("state", ciState); return result; } }
|
SensorWsController { @RequestMapping(value = "/ops/states/{ciId}", method = RequestMethod.GET) @ResponseBody public Map<String, String> getCIstate(@PathVariable long ciId) { String ciState = coProcessor.getCIstate(ciId); Map<String, String> result = new HashMap<String, String>(); result.put("id", String.valueOf(ciId)); result.put("state", ciState); return result; } void setSensorListener(SensorListener sensorListener); void setTsDao(ThresholdsDao tsDao); void setSensorTools(SensorTools sensorTools); void setRestorer(MonitorRestorer restorer); void setCoProcessor(CiOpsProcessor coProcessor); void setOeDao(OpsEventDao oeDao); void setSensor(Sensor sensor); void setSensorHeartBeat(SensorHeartBeat sensorHeartBeat); @RequestMapping(method = RequestMethod.POST, value = "/monitors/start") @ResponseBody String startTracking(
@RequestBody CmsWorkOrderSimple woSimple,
@RequestHeader(value = "X-Cms-Scope", required = false) String scope); @RequestMapping(method = RequestMethod.GET, value = "/monitors/restore") @ResponseBody String restoreMonitors(
@RequestParam(value = "writeMode", required = false, defaultValue = "false") boolean writeMode,
@RequestParam(value = "manifestId", required = false) Long manifestId); @RequestMapping(value = "/ops/events/{ciId}", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, List<CiOpenEvent>>> getCIOpenEvents(@PathVariable long ciId); @RequestMapping(value = "/ops/events", method = RequestMethod.GET) @ResponseBody List<Map<Long, Map<String, List<CiOpenEvent>>>> getOpenEvents(
@RequestParam(value = "ciIds", required = true) String ciIdsStr); @RequestMapping(method = RequestMethod.POST, value = "/ops/events") @ResponseBody List<Map<Long, Map<String, List<CiOpenEvent>>>> processOpenEvents(
@RequestBody Long[] ciIdsAr); @RequestMapping(value = "/ops/states/{ciId}", method = RequestMethod.GET) @ResponseBody Map<String, String> getCIstate(@PathVariable long ciId); @RequestMapping(value = "/ops/states/{ciId}/history", method = RequestMethod.GET) @ResponseBody List<CiChangeStateEvent> getCIstateHist(@PathVariable long ciId,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/ops/states", method = RequestMethod.GET) @ResponseBody List<Map<String, String>> getCisStatesGet(
@RequestParam(value = "ciIds", required = true) String ciIdsStr); @RequestMapping(value = "/ops/states", method = RequestMethod.POST) @ResponseBody List<Map<String, String>> getCisStatesPost(
@RequestBody Long[] ciIdsAr); @RequestMapping(value = "/ops/components/states/counts", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Long>> getManifestStatesCountsGet(
@RequestParam(value = "ids", required = false) String ciIdsStr); @RequestMapping(value = "/ops/components/all/states", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Long>> getAllManifestStates(); @RequestMapping(value = "/ops/components/states/reset", method = RequestMethod.GET) @ResponseBody Map<String, String> resetManifestStates(
@RequestParam(value = "ids", required = false) String ciIdsStr); @RequestMapping(value = "/ops/components/states/count", method = RequestMethod.POST) @ResponseBody Map<Long, Map<String, Long>> getManifestStatesCounts(
@RequestBody Long[] idsAr); @RequestMapping(value = "/ops/components/states", method = RequestMethod.POST) @ResponseBody Map<Long, Map<String, Integer>> getManifestStatesPost(
@RequestBody Long[] idsAr); @RequestMapping(value = "/ops/components/old/states", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Integer>> getManifestStatesGet(
@RequestParam(value = "ids", required = true) String ciIdsStr); @RequestMapping(value = "/ops/events/{ciId}/close/{eventName}", method = RequestMethod.GET) @ResponseBody List<CiOpenEvent> closeCIevent(@PathVariable long ciId, @PathVariable String eventName); @RequestMapping(value = "/ops/events/{ciId}/history/{source}", method = RequestMethod.GET) @ResponseBody Map<String, List<OpsEvent>> getEventHistory(@PathVariable long ciId,
@PathVariable String source,
@RequestParam(value = "threshold", required = true) String[] thresholds,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/ops/events/{ciId}/history", method = RequestMethod.GET) @ResponseBody List<OpsEvent> getAllEventHistory(@PathVariable long ciId,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/esper/stmts", method = RequestMethod.GET) @ResponseBody Map<String, String> getLoadedStmts(); @RequestMapping(value = "/esper/stmts/count", method = RequestMethod.GET) @ResponseBody Map<String, Integer> getLoadedStmtsCount(); @RequestMapping(value = "/esper/stmts/{ciId}/load/{source}", method = RequestMethod.GET) @ResponseBody Map<String, String> loadStmts(@PathVariable long ciId,
@PathVariable String source); @RequestMapping(value = "/ops/events/{ciId}/send", method = RequestMethod.GET) @ResponseBody String sendEmptyEvent(@PathVariable long ciId,
@RequestParam(value = "source", required = true) String source,
@RequestParam(value = "manifestId", required = true) long manifestId); @RequestMapping(value = "/log/{ciId}/{action}", method = RequestMethod.GET) @ResponseBody String setLogingForCi(@PathVariable long ciId,
@PathVariable String action); @RequestMapping(value = "/channels/status", method = RequestMethod.GET) @ResponseBody Map<String, ChannelState> getChannelStates(); @RequestMapping(value = "/utils/validatethresholds", method = RequestMethod.GET) @ResponseBody String validateThresholds(); @RequestMapping(value = "/status", method = RequestMethod.GET) @ResponseBody String checkStatus(); @RequestMapping(value = "/events/count", method = RequestMethod.GET) @ResponseBody String getEventProcessingCount(); }
|
SensorWsController { @RequestMapping(value = "/ops/states/{ciId}", method = RequestMethod.GET) @ResponseBody public Map<String, String> getCIstate(@PathVariable long ciId) { String ciState = coProcessor.getCIstate(ciId); Map<String, String> result = new HashMap<String, String>(); result.put("id", String.valueOf(ciId)); result.put("state", ciState); return result; } void setSensorListener(SensorListener sensorListener); void setTsDao(ThresholdsDao tsDao); void setSensorTools(SensorTools sensorTools); void setRestorer(MonitorRestorer restorer); void setCoProcessor(CiOpsProcessor coProcessor); void setOeDao(OpsEventDao oeDao); void setSensor(Sensor sensor); void setSensorHeartBeat(SensorHeartBeat sensorHeartBeat); @RequestMapping(method = RequestMethod.POST, value = "/monitors/start") @ResponseBody String startTracking(
@RequestBody CmsWorkOrderSimple woSimple,
@RequestHeader(value = "X-Cms-Scope", required = false) String scope); @RequestMapping(method = RequestMethod.GET, value = "/monitors/restore") @ResponseBody String restoreMonitors(
@RequestParam(value = "writeMode", required = false, defaultValue = "false") boolean writeMode,
@RequestParam(value = "manifestId", required = false) Long manifestId); @RequestMapping(value = "/ops/events/{ciId}", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, List<CiOpenEvent>>> getCIOpenEvents(@PathVariable long ciId); @RequestMapping(value = "/ops/events", method = RequestMethod.GET) @ResponseBody List<Map<Long, Map<String, List<CiOpenEvent>>>> getOpenEvents(
@RequestParam(value = "ciIds", required = true) String ciIdsStr); @RequestMapping(method = RequestMethod.POST, value = "/ops/events") @ResponseBody List<Map<Long, Map<String, List<CiOpenEvent>>>> processOpenEvents(
@RequestBody Long[] ciIdsAr); @RequestMapping(value = "/ops/states/{ciId}", method = RequestMethod.GET) @ResponseBody Map<String, String> getCIstate(@PathVariable long ciId); @RequestMapping(value = "/ops/states/{ciId}/history", method = RequestMethod.GET) @ResponseBody List<CiChangeStateEvent> getCIstateHist(@PathVariable long ciId,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/ops/states", method = RequestMethod.GET) @ResponseBody List<Map<String, String>> getCisStatesGet(
@RequestParam(value = "ciIds", required = true) String ciIdsStr); @RequestMapping(value = "/ops/states", method = RequestMethod.POST) @ResponseBody List<Map<String, String>> getCisStatesPost(
@RequestBody Long[] ciIdsAr); @RequestMapping(value = "/ops/components/states/counts", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Long>> getManifestStatesCountsGet(
@RequestParam(value = "ids", required = false) String ciIdsStr); @RequestMapping(value = "/ops/components/all/states", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Long>> getAllManifestStates(); @RequestMapping(value = "/ops/components/states/reset", method = RequestMethod.GET) @ResponseBody Map<String, String> resetManifestStates(
@RequestParam(value = "ids", required = false) String ciIdsStr); @RequestMapping(value = "/ops/components/states/count", method = RequestMethod.POST) @ResponseBody Map<Long, Map<String, Long>> getManifestStatesCounts(
@RequestBody Long[] idsAr); @RequestMapping(value = "/ops/components/states", method = RequestMethod.POST) @ResponseBody Map<Long, Map<String, Integer>> getManifestStatesPost(
@RequestBody Long[] idsAr); @RequestMapping(value = "/ops/components/old/states", method = RequestMethod.GET) @ResponseBody Map<Long, Map<String, Integer>> getManifestStatesGet(
@RequestParam(value = "ids", required = true) String ciIdsStr); @RequestMapping(value = "/ops/events/{ciId}/close/{eventName}", method = RequestMethod.GET) @ResponseBody List<CiOpenEvent> closeCIevent(@PathVariable long ciId, @PathVariable String eventName); @RequestMapping(value = "/ops/events/{ciId}/history/{source}", method = RequestMethod.GET) @ResponseBody Map<String, List<OpsEvent>> getEventHistory(@PathVariable long ciId,
@PathVariable String source,
@RequestParam(value = "threshold", required = true) String[] thresholds,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/ops/events/{ciId}/history", method = RequestMethod.GET) @ResponseBody List<OpsEvent> getAllEventHistory(@PathVariable long ciId,
@RequestParam(value = "start", required = false) Long start,
@RequestParam(value = "end", required = false) Long end,
@RequestParam(value = "count", required = false) Integer count); @RequestMapping(value = "/esper/stmts", method = RequestMethod.GET) @ResponseBody Map<String, String> getLoadedStmts(); @RequestMapping(value = "/esper/stmts/count", method = RequestMethod.GET) @ResponseBody Map<String, Integer> getLoadedStmtsCount(); @RequestMapping(value = "/esper/stmts/{ciId}/load/{source}", method = RequestMethod.GET) @ResponseBody Map<String, String> loadStmts(@PathVariable long ciId,
@PathVariable String source); @RequestMapping(value = "/ops/events/{ciId}/send", method = RequestMethod.GET) @ResponseBody String sendEmptyEvent(@PathVariable long ciId,
@RequestParam(value = "source", required = true) String source,
@RequestParam(value = "manifestId", required = true) long manifestId); @RequestMapping(value = "/log/{ciId}/{action}", method = RequestMethod.GET) @ResponseBody String setLogingForCi(@PathVariable long ciId,
@PathVariable String action); @RequestMapping(value = "/channels/status", method = RequestMethod.GET) @ResponseBody Map<String, ChannelState> getChannelStates(); @RequestMapping(value = "/utils/validatethresholds", method = RequestMethod.GET) @ResponseBody String validateThresholds(); @RequestMapping(value = "/status", method = RequestMethod.GET) @ResponseBody String checkStatus(); @RequestMapping(value = "/events/count", method = RequestMethod.GET) @ResponseBody String getEventProcessingCount(); }
|
@Test public void localVarRefersToGVPrefix() { Map<String, String> localVars = new HashMap<>(3); localVars.put("lv1", "$OO_GLOBAL{gv1}"); Map<String, String> globalVars = new HashMap<>(3); globalVars.put("gv1", "globalVar1"); Map<String, String> cloudVars = new HashMap<>(3); cloudVars.put("cv1", "cloudVar1"); CmsCI ci = new CmsCI(); ci.setCiId(90); ci.setCiName("localVarRefersAnotherGVar"); Map<String, CmsCIAttribute> attributes = new LinkedHashMap<>(2); CmsCIAttribute attr4 = new CmsCIAttribute(); attr4.setDjValue("Prefix $OO_LOCAL{lv1}"); attributes.put("localVarRefersAnotherLVar", attr4); ci.setAttributes(attributes); Map<String, CmsCIAttribute> attributesBefore = ci.getAttributes(); for (Map.Entry<String, CmsCIAttribute> e : attributesBefore.entrySet()) { System.out.println("*- b4 |" + e.getKey() + "->" + e.getValue().getDjValue()); } CmsUtil util = getCmsUtil(); dumpMaps(cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); util.processAllVars(ci, cloudVars, globalVars, localVars); dumpCmsCIAttributes(ci); for (Map.Entry<String, CmsCIAttribute> a : ci.getAttributes().entrySet()) { String djKey = a.getKey(); String djAfter = a.getValue().getDjValue(); System.out.println("*after k>" + djKey + " v->" + djAfter); if (djKey.equals("localVarRefersAnotherLVar")) { assertEquals(djAfter, "Prefix globalVar1"); } } }
|
public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); }
|
CmsUtil { public void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat) { processAllVars(ci, getCloudVars(cloud), getGlobalVars(env), getLocalVars(plat)); } static String likefyNsPath(String queryParam); static String likefyNsPathWithBom(String queryParam); static String likefyNsPathWithoutEndingSlash(String queryParam); static String likefyNsPathWithFilter(String envNs, String type, String filter); static String likefyNsPathWithTypeNoEndingSlash(String envNs, String type); static boolean isOrgLevel(String nsPath); static CmsWorkOrderSimpleBase maskSecuredFields(CmsWorkOrderSimpleBase<T> cmsWoSimpleBase, String type); static String generateRelComments(String fromCiName, String fromCiClass, String toCiName, String toCiClass); void setCmProcessor(CmsCmProcessor cmProcessor); void setCmsCrypto(CmsCrypto cmsCrypto); void setRfcUtil(CmsRfcUtil rfcUtil); CmsCI custCISimple2CI(CmsCISimple ciSimple, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType); CmsCISimpleWithTags cmsCISimpleWithTags(CmsCI ci, String valueType); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, boolean getEncrypted); CmsCISimple custCI2CISimple(CmsCI ci, String valueType, String attrProps, boolean getEncrypted, String includeAltNs); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted); CmsCIRelationSimple custCIRelation2CIRelationSimple(CmsCIRelation rel, String valueType, boolean getEncrypted, String[] attrProps); CmsCIRelation custCIRelationSimple2CIRelation(CmsCIRelationSimple relSimple, String valueType); CmsRfcCI custRfcCISimple2RfcCI(CmsRfcCISimple rfcSimple); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String attrProps); CmsRfcCISimple custRfcCI2RfcCISimple(CmsRfcCI rfc, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String[] attrProps); CmsRfcRelationSimple custRfcRel2RfcRelSimple(CmsRfcRelation relation, String attrProps); CmsRfcRelation custRfcRelSimple2RfcRel(CmsRfcRelationSimple relationSimple); CmsWorkOrderSimple custWorkOrder2Simple(CmsWorkOrder wo); CmsWorkOrder custSimple2WorkOrder(CmsWorkOrderSimple wos); CmsActionOrderSimple custActionOrder2Simple(CmsActionOrder ao); CmsActionOrder custSimple2ActionOrder(CmsActionOrderSimple aos); List<AttrQueryCondition> parseConditions(String[] attrs); String getShortClazzName(String fullClazzName); String getLongShortClazzName(String fullClazzName); void processAllVars(CmsCI ci,CmsCI env , CmsCI cloud, CmsCI plat); void processAllVars(CmsCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); void processAllVars(CmsRfcCI ci, Map<String, String> cloudVars, Map<String, String> globalVars, Map<String, String> localVars); Map<String, String> getGlobalVars(CmsCI env); List<CmsRfcCI> getGlobalVarsRfcs(CmsCI env); Map<String, String> getLocalVars(CmsCI plat); List<CmsRfcCI> getLocalVarsRfcs(CmsCI plat); Map<String, String> getCloudVars(CmsCI cloud); List<CmsRfcCI> getCloudVarsRfcs(CmsCI cloud); Map<String, List<CmsCI>> getResolvedVariableCIs(CmsCI cloud, CmsCI env, CmsCI platform); int getCountOfErrorsToReport(); void setCountOfErrorsToReport(int countOfErrorsToReport); static final String CLOUD_VARS_PAYLOAD_NAME; static final String GLOBAL_VARS_PAYLOAD_NAME; static final String LOCAL_VARS_PAYLOAD_NAME; static final String WORK_ORDER_TYPE; static final String ACTION_ORDER_TYPE; }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.