Search in sources :

Example 1 with ConfigClassRegistry

use of net.jangaroo.exml.model.ConfigClassRegistry in project jangaroo-tools by CoreMedia.

the class MxmlLibraryManifestGeneratorTest method testCreateManifestFile.

@Test
public void testCreateManifestFile() throws Exception {
    ExmlConfiguration exmlConfiguration = mock(ExmlConfiguration.class);
    when(exmlConfiguration.getSourcePath()).thenReturn(Collections.singletonList(temporaryFolder.newFolder("out")));
    ConfigClass configClass1 = mock(ConfigClass.class);
    when(configClass1.getFullName()).thenReturn("foo");
    when(configClass1.getType()).thenReturn(ConfigClassType.CLASS);
    when(configClass1.getComponentClassName()).thenReturn("Foo");
    ConfigClass configClass2 = mock(ConfigClass.class);
    when(configClass2.getFullName()).thenReturn("bar");
    when(configClass2.getType()).thenReturn(ConfigClassType.CLASS);
    when(configClass2.getComponentClassName()).thenReturn("Bar");
    ConfigClass configClass3 = mock(ConfigClass.class);
    when(configClass3.getFullName()).thenReturn("comp");
    when(configClass3.getType()).thenReturn(ConfigClassType.COMPONENT);
    when(configClass3.getComponentClassName()).thenReturn("Comp");
    ConfigClassRegistry configClassRegistry = mock(ConfigClassRegistry.class);
    when(configClassRegistry.getConfig()).thenReturn(exmlConfiguration);
    when(configClassRegistry.getSourceConfigClasses()).thenReturn(asList(configClass1, configClass2, configClass3));
    File manifest = new MxmlLibraryManifestGenerator(configClassRegistry).createManifestFile();
    assertEquals(IOUtils.toString(getClass().getResourceAsStream("/expected/manifest.xml")), readFileToString(manifest));
}
Also used : ConfigClass(net.jangaroo.exml.model.ConfigClass) ConfigClassRegistry(net.jangaroo.exml.model.ConfigClassRegistry) ExmlConfiguration(net.jangaroo.exml.config.ExmlConfiguration) File(java.io.File) Test(org.junit.Test)

Example 2 with ConfigClassRegistry

use of net.jangaroo.exml.model.ConfigClassRegistry in project jangaroo-tools by CoreMedia.

the class ExmlToMxmlTest method getConfigClassRegistry.

@Override
public ConfigClassRegistry getConfigClassRegistry() {
    ConfigClassRegistry configClassRegistry = super.getConfigClassRegistry();
    configClassRegistry.getConfig().setKeepExmlFiles(true);
    return configClassRegistry;
}
Also used : ConfigClassRegistry(net.jangaroo.exml.model.ConfigClassRegistry)

Aggregations

ConfigClassRegistry (net.jangaroo.exml.model.ConfigClassRegistry)2 File (java.io.File)1 ExmlConfiguration (net.jangaroo.exml.config.ExmlConfiguration)1 ConfigClass (net.jangaroo.exml.model.ConfigClass)1 Test (org.junit.Test)1