Skip to content

Instantly share code, notes, and snippets.

View danglotb's full-sized avatar
Don't get distracted, time flies

Benjamin DANGLOT danglotb

Don't get distracted, time flies
View GitHub Profile
@Test(timeout = 120000)
public void testCreateAndDeleteMonitorConfiguration_add1() throws Exception {
AppStoreMonitorConfiguration o_testCreateAndDeleteMonitorConfiguration_add1__1 = createMonitorConfiguration();
Assert.assertEquals("localhost", ((java.net.URI)((java.net.URL)((eu.supersede.integration.api.monitoring.manager.types.AppStoreMonitorConfiguration)o_testCreateAndDeleteMonitorConfiguration_add1__1).getKafkaEndpoint()).toURI()).getHost());
Assert.assertEquals("//localhost:9092", ((java.net.URI)((java.net.URL)((eu.supersede.integration.api.monitoring.manager.types.AppStoreMonitorConfiguration)o_testCreateAndDeleteMonitorConfiguration_add1__1).getKafkaEndpoint()).toURI()).getRawSchemeSpecificPart());
Assert.assertNull(((eu.supersede.integration.api.monitoring.manager.types.AppStoreMonitorConfiguration)o_testCreateAndDeleteMonitorConfiguration_add1__1).getId());
Assert.assertEquals(0, ((int) (((java.net.URLConnection)((java.net.URL)((eu.supersede.integration.api.monitoring.manager.ty
@Test
public void testMergeCharList() throws Exception
{
MergeResult<Character> result;
// New empty
result = this.mocker.getComponentUnderTest()
.merge(toCharacters("a"), toCharacters(""), toCharacters("b"), null);
@Test
public void getReaderNullRootDoesNotFindFileWithAbsolutePath() throws Exception {
ClasspathResolver underTest = new ClasspathResolver();
Reader reader = underTest.getReader("/nested_partials_template.html");
assertThat(reader, is(nullValue()));
}
@Test public void parsesBooleanAttributes() {
String html = "<a normal=\"123\" boolean empty=\"\"></a>";
Element el = Jsoup.parse(html).select("a").first();
assertEquals("123", el.attr("normal"));
assertEquals("", el.attr("boolean"));
assertEquals("", el.attr("empty"));
List<Attribute> attributes = el.attributes().asList();
assertEquals("There should be 3 attribute present", 3, attributes.size());
public void testNumberDeserialization() {
String json = "1";
Number expected = new Integer(json);
Number actual = gson.fromJson(json, Number.class);
assertEquals(expected.intValue(), actual.intValue());
json = String.valueOf(Long.MAX_VALUE);
expected = new Long(json);
actual = gson.fromJson(json, Number.class);
assertEquals(expected.longValue(), actual.longValue());
@Test
public void testAppendSuper() {
assertEquals(
"{}",
new ToStringBuilder(base).appendSuper(
"Integer@8888[" + System.lineSeparator() + "]")
.toString());
assertEquals(
"{}",
new ToStringBuilder(base).appendSuper(
@Test
public void readMulti() throws IOException {
BoundedReader mr = new BoundedReader( sr, 3 );
char[] cbuf = new char[4];
for ( int i = 0; i < cbuf.length; i++ )
{
cbuf[i] = 'X';
}
final int read = mr.read( cbuf, 0, 4 );
assertEquals( 3, read );
@Test
public void testMergeWhenUserHasChangedAllContent() throws Exception
{
MergeResult<String> result;
// Test 1: All content has changed between previous and current
result = mocker.getComponentUnderTest().merge(Arrays.asList("Line 1", "Line 2", "Line 3"),
Arrays.asList("Line 1", "Line 2 modified", "Line 3", "Line 4 Added"),
Arrays.asList("New content", "That is completely different"), null);
@Test(timeout = 10000)
public void testMergeCharList() throws Exception {
MergeResult<Character> result;
result = this.mocker.getComponentUnderTest().merge(AmplDefaultDiffManagerTest.toCharacters("a"),
AmplDefaultDiffManagerTest.toCharacters(""), AmplDefaultDiffManagerTest.toCharacters("b"), null);
int o_testMergeCharList__9 = result.getLog().getLogs(LogLevel.ERROR).size();
Assert.assertEquals(1, ((int) (o_testMergeCharList__9)));
List<Character> o_testMergeCharList__12 = AmplDefaultDiffManagerTest.toCharacters("b");
Assert.assertTrue(o_testMergeCharList__12.contains('b'));
result.getMerged();
@Test
public void getReaderWithRootAndResourceHasDoubleDotRelativePath() throws Exception {
ClasspathResolver underTest = new ClasspathResolver("templates");
Reader reader = underTest.getReader("absolute/../absolute_partials_template.html");
assertThat(reader, is(notNullValue()));
}
@Test
public void getReaderWithRootAndResourceHasDotRelativePath() throws Exception {
ClasspathResolver underTest = new ClasspathResolver("templates");