blob: 066b53836214c6acac7493aa413a317550415715 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.codegen;
import com.github.myproject.NamespaceAndPackageConfig;
import com.github.myproject.PackageConfig;
import com.yahoo.my.namespace.NamespaceConfig;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
/**
* @author gjoranv
*/
public class NamespaceAndPackageTest {
private static String NAMESPACE = "my.namespace";
private static String PACKAGE = "com.github.myproject";
@Test
public void namespace_is_set_from_def_file() {
assertThat(NamespaceConfig.CONFIG_DEF_NAMESPACE, is(NAMESPACE));
}
@Test
public void package_is_used_as_namespace_when_namespace_is_not_set_explicitly() {
assertThat(PackageConfig.CONFIG_DEF_NAMESPACE, is(PACKAGE));
}
@Test
public void package_does_not_override_namespace() {
assertThat(NamespaceAndPackageConfig.CONFIG_DEF_NAMESPACE, is(NAMESPACE));
}
}
|