@Test public void testBuildAssertionElement() { String connectionName = "cassandraTest"; Element cassandraAssertion = createCassandraAssertion(document, connectionName); policyBuilderContext = new PolicyBuilderContext("path.xml", document, bundle, new IdGenerator()); policyBuilderContext.withPolicy(policy); cassandraAssertionBuilder.buildAssertionElement(cassandraAssertion, policyBuilderContext); Element cassandraConnectionName = getSingleChildElement(cassandraAssertion, CASSANDRA_CONNECTION_NAME, true); assertNotNull(cassandraConnectionName); assertEquals("::" + projectInfo.getGroupName() + "::" + connectionName + "::1.0", cassandraConnectionName.getAttributes().getNamedItem(STRING_VALUE).getTextContent()); }
@Override public void buildAssertionElement(Element assertionElement, PolicyBuilderContext policyBuilderContext) { final Bundle bundle = policyBuilderContext.getBundle(); final Element connectionNameElement = getSingleChildElement(assertionElement, CASSANDRA_CONNECTION_NAME, true); if (connectionNameElement != null) { final String connectionName = connectionNameElement.getAttributes().getNamedItem(STRING_VALUE).getTextContent(); connectionNameElement.setAttribute(STRING_VALUE, bundle.applyUniqueName(connectionName, ENVIRONMENT)); } }
CassandraAssertionBuilder implements PolicyAssertionBuilder { @Override public void buildAssertionElement(Element assertionElement, PolicyBuilderContext policyBuilderContext) { final Bundle bundle = policyBuilderContext.getBundle(); final Element connectionNameElement = getSingleChildElement(assertionElement, CASSANDRA_CONNECTION_NAME, true); if (connectionNameElement != null) { final String connectionName = connectionNameElement.getAttributes().getNamedItem(STRING_VALUE).getTextContent(); connectionNameElement.setAttribute(STRING_VALUE, bundle.applyUniqueName(connectionName, ENVIRONMENT)); } } }
CassandraAssertionBuilder implements PolicyAssertionBuilder { @Override public void buildAssertionElement(Element assertionElement, PolicyBuilderContext policyBuilderContext) { final Bundle bundle = policyBuilderContext.getBundle(); final Element connectionNameElement = getSingleChildElement(assertionElement, CASSANDRA_CONNECTION_NAME, true); if (connectionNameElement != null) { final String connectionName = connectionNameElement.getAttributes().getNamedItem(STRING_VALUE).getTextContent(); connectionNameElement.setAttribute(STRING_VALUE, bundle.applyUniqueName(connectionName, ENVIRONMENT)); } }  }
CassandraAssertionBuilder implements PolicyAssertionBuilder { @Override public void buildAssertionElement(Element assertionElement, PolicyBuilderContext policyBuilderContext) { final Bundle bundle = policyBuilderContext.getBundle(); final Element connectionNameElement = getSingleChildElement(assertionElement, CASSANDRA_CONNECTION_NAME, true); if (connectionNameElement != null) { final String connectionName = connectionNameElement.getAttributes().getNamedItem(STRING_VALUE).getTextContent(); connectionNameElement.setAttribute(STRING_VALUE, bundle.applyUniqueName(connectionName, ENVIRONMENT)); } }  @Override void buildAssertionElement(Element assertionElement, PolicyBuilderContext policyBuilderContext); @Override String getAssertionTagName(); }
CassandraAssertionBuilder implements PolicyAssertionBuilder { @Override public void buildAssertionElement(Element assertionElement, PolicyBuilderContext policyBuilderContext) { final Bundle bundle = policyBuilderContext.getBundle(); final Element connectionNameElement = getSingleChildElement(assertionElement, CASSANDRA_CONNECTION_NAME, true); if (connectionNameElement != null) { final String connectionName = connectionNameElement.getAttributes().getNamedItem(STRING_VALUE).getTextContent(); connectionNameElement.setAttribute(STRING_VALUE, bundle.applyUniqueName(connectionName, ENVIRONMENT)); } }  @Override void buildAssertionElement(Element assertionElement, PolicyBuilderContext policyBuilderContext); @Override String getAssertionTagName();  }