Example usage for org.springframework.boot.loader.tools Layouts.None Layouts.None

List of usage examples for org.springframework.boot.loader.tools Layouts.None Layouts.None

Introduction

In this page you can find the example usage for org.springframework.boot.loader.tools Layouts.None Layouts.None.

Prototype

Layouts.None

Source Link

Usage

From source file:org.springframework.boot.loader.tools.RepackagerTests.java

@Test
public void noMainClassAndLayoutIsNone() throws Exception {
    this.testJarFile.addClass("a/b/C.class", ClassWithMainMethod.class);
    File file = this.testJarFile.getFile();
    Repackager repackager = new Repackager(file);
    repackager.setLayout(new Layouts.None());
    repackager.repackage(file, NO_LIBRARIES);
    Manifest actualManifest = getManifest(file);
    assertThat(actualManifest.getMainAttributes().getValue("Main-Class")).isEqualTo("a.b.C");
    assertThat(hasLauncherClasses(file)).isFalse();
}

From source file:org.springframework.boot.loader.tools.RepackagerTests.java

@Test
public void noMainClassAndLayoutIsNoneWithNoMain() throws Exception {
    this.testJarFile.addClass("a/b/C.class", ClassWithoutMainMethod.class);
    File file = this.testJarFile.getFile();
    Repackager repackager = new Repackager(file);
    repackager.setLayout(new Layouts.None());
    repackager.repackage(file, NO_LIBRARIES);
    Manifest actualManifest = getManifest(file);
    assertThat(actualManifest.getMainAttributes().getValue("Main-Class")).isNull();
    assertThat(hasLauncherClasses(file)).isFalse();
}